#I want to make it so a Gui appears for 5 seconds then disappears but must be activated by a part

13 messages · Page 1 of 1 (latest)

twin heart
#

Here is the code
Popup = script.Parent.SpawnInfoScreen
Ready = true
function onTouch(hit)
local h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil and Ready == true then
Ready = false
local plyr = game.Players:FindFirstChild(h.Parent.Name)
local c = Popup:clone()
c.Parent = plyr.PlayerGui
wait(3)
c:remove()
wait(1)
Ready = true
end
end

script.Parent.Touched:connect(onTouch)

This code is from a yt vid and idk why its not working

lapis perch
#
local Ready = true

function onTouch(hit)
    local h = hit.Parent:FindFirstChild("Humanoid")
    if h ~= nil and Ready then
        Ready = false
        local plyr = game.Players:GetPlayerFromCharacter(h.Parent) 
        if plyr then
            local c = Popup:Clone()
            c.Parent = plyr.PlayerGui
            wait(5) 
            c:Destroy() 
        end
        wait(1)
        Ready = true
    end
end

script.Parent.Touched:Connect(onTouch)```
#

this should fix the problem.

golden notch
#

Of course you don’t know why it doesn’t work since this is not your script 🦧

lapis perch
short wyvernBOT
#

studio** You are now Level 3! **studio

golden notch
lapis perch
lapis perch
twin heart
#

Nope

#

it doenst even add it to the folder now

#

ill work on it later