for _, v in pairs(ItemRooms) do
local Peadastol = v.Pedastol
Peadastol.Touched:Connect(function(p)
if p.Parent:FindFirstChild("Humanoid") and DescCoolDown == false then
DescCoolDown = true
for _, x in pairs(v:GetDescendants()) do
if x:IsA("Model") and game.ReplicatedStorage.Items:FindFirstChild(x.Name) then
local GUI = script.DescGUI:Clone()
local Desc = x:FindFirstChild("Description")
local Player = game.Players:FindFirstChild(p.Parent.Name)
GUI.Holder.Description.Text = Desc.Value
GUI.Holder.Item.Text = x.Name
GUI.Parent = Player.PlayerGui
wait(5)
GUI:Destroy()
DescCoolDown = false
end
end
end
end)
end
So, I have this script that checks if you touch a pedestal, it takes the item name and description (within the item) and places a gui into you.
I am wondering how I would go about deleting the gui when you grab another item and the 1st gui isnt done showing you the item and description yet?
For example, you grab an item and it shows you the Item and description. Then, before the wait(5) is over you grab another item. I want it to Delete the old gui and make a new one so they dont overlap...
