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 6 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)

local items = script.Parent.Frame:GetChildren()
for i = 1, #items do
function buy()
Gold = script.Parent.Parent.Parent.Parent.leaderstats:FindFirstChild(items[i].Currency.Value)
h = Instance.new("Hint")
h.Parent = script.Parent.Parent.Parent
if Gold.Value >= items[i].Cost.Value then
Gold.Value = Gold.Value - items[i].Cost.Value
toolca = game.Lighting:FindFirstChild(items[i].ItemName.Value):Clone()
toolcb = game.Lighting:FindFirstChild(items[i].ItemName.Value):Clone()
toolca.Parent = script.Parent.Parent.Parent.Parent.Backpack
toolcb.Parent = script.Parent.Parent.Parent.Parent.StarterGear
end
end
items[i].BuyButton.MouseButton1Click:connect(buy)
end

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 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.

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

Answer this question