So if the player touches a certain part, a GUI within that part will show up. This works fine, but the GUI will clone and overlap itself many times when I only want one of it. I tried adding debounce but then it somehow only works once, and wont show up again if the player restarts. (I use FE btw) How can I fix this problem?
local menu = script.Parent.Animations
local function onTouched(hit)
if (game.Players:GetPlayerFromCharacter(hit.Parent)) then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if not player.PlayerGui:findFirstChild("menu") then
menu:Clone().Parent = player.PlayerGui
wait()
end
end
end
script.Parent.Touched:connect(onTouched)

1 comment
I've played around with it, and somehow if I change that line then the GUI wont work after I've reset my character. Weird. Thanks for trying though :)