I was experimenting that I want that when a player touch a part, The gui shows and it's shows again when a player touchs the part again. But the script that i have it's only close the gui and it's doesn't open anymore. "It's a teleportation Gui but i want that the gui shows repeatedly"

This is the script:

local Part = script.Parent
local Debounce = false

Part.Touched:Connect(function(hit)
    if Debounce == false then
        Debounce = true
        if hit.Parent:FindFirstChild("Humanoid") then
            local plr = game.Players:GetPlayerFromCharacter(hit.Parent).PlayerGui
            script.ScreenGui:Clone().Parent = plr -- replace "ScreenGui" with the name of your ScreenGui
        end
        wait(1)
        Debounce = false
    end
end)

Close teleport gui script:

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Visible = false
end)

9 comments

0

Can u give us the other script that is in the part

0

What do you mean?

0

Don't u have 2 scripts one in the part and one in the gui

0

Yes

0

Can u show them in your post?? It would make it easier to help you if we understand all the scripts.

0

Ok

0

Can you update your post showing the other script

0

Ok

0

Updated! Sorry for the long wait, I was so busy on my journey in my pc lol