Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Need help with ("Hint"), or message in script that will not close?

Asked by 7 years ago

When clicked, the button gives a tool and prints a message. The problem is the message doesnt go away so when the shop gui is closed, you can not open it again (part on touched open gui). I think it is the "hint" s fault because it also doesnt say anything. if someone could get rid of the hint (make it say something and close), that would be great. (i suck at scripting)

01local items = script.Parent.Frame:GetChildren()
02for i = 1, #items do
03function buy()
04Gold = script.Parent.Parent.Parent.Parent.leaderstats:FindFirstChild(items[i].Currency.Value)
05h = Instance.new("Hint")
06h.Parent = script.Parent.Parent.Parent
07if Gold.Value >= items[i].Cost.Value then
08Gold.Value = Gold.Value - items[i].Cost.Value
09toolca = game.Lighting:FindFirstChild(items[i].ItemName.Value):Clone()
10toolcb = game.Lighting:FindFirstChild(items[i].ItemName.Value):Clone()
11toolca.Parent = script.Parent.Parent.Parent.Parent.Backpack
12toolcb.Parent = script.Parent.Parent.Parent.Parent.StarterGear
13end
14end
15items[i].BuyButton.MouseButton1Click:connect(buy)
16end

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

A simple answer to your question would be to use the wait(x) function (where x is the time in seconds). After that, just destroy it.

1new = Instance.new("Hint")
2wait(2) -- wait two seconds
3new:Destroy() -- removes it
Ad

Answer this question