Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

Why the Gui doesn't open again when a player close the Gui after touch a part?

Asked by 2 years ago
Edited 1 year ago

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)
0
Can u give us the other script that is in the part theking66hayday 841 — 2y
0
What do you mean? Queen1234_XD -26 — 2y
0
Don't u have 2 scripts one in the part and one in the gui theking66hayday 841 — 2y
0
Yes Queen1234_XD -26 — 2y
View all comments (5 more)
0
Can u show them in your post?? It would make it easier to help you if we understand all the scripts. theking66hayday 841 — 2y
0
Ok Queen1234_XD -26 — 2y
0
Can you update your post showing the other script theking66hayday 841 — 2y
0
Ok Queen1234_XD -26 — 2y
0
Updated! Sorry for the long wait, I was so busy on my journey in my pc lol Queen1234_XD -26 — 1y

Answer this question