#how do i make a msg appear if an item is clicked on, and then disappear after? ^^

1 messages · Page 1 of 1 (latest)

mint plume
#

I wanna add 'decoys' in my game to throw the player off during searching for somthing in a library me and my friend have built, but i dont know how to script very well ^^

thin tusk
#

well. first, you need to set up a GUI. that GUI will be the message. for example, TextLabel. make sure that the "Visible" property is set to False.

then make the Item. insert a script into it, and a ClickDetector that will detect clicks.

now, script the Item:

local clickDetector = Item:FindFirstChild("ClickDetector")

clickDetector.MouseClick:Connect(function(player)
    local TextLabel = player.PlayerGui.ScreenGui.TextLabel
    
    TextLabel.Visible = true --making it visible
    TextLabel.Text = "you have clicked the item!" --the message
    
    task.wait(3) --waiting 3 seconds
    
    TextLabel.Visible = false --making the message go invisible
end)```
#

@mint plume