Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is there any way to restrict the player movements while the gui is on the screen?

I'm pretty sure you dont need any more info than this:

The script thats in the part:


local part = script.Parent
local debounce = false
part.Touched:Connect(
    function(hit)
        if debounce == false then
            debounce = true
            local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
            if plr then
                plr:WaitForChild("PlayerGui").Quest1.Frame.Visible = true
                ("PlayerGui").Quest1.Frame.Visible = true
            end
            wait(3)
            debounce = false
        else
            print("wait.........")
        end
    end
)
part.TouchEnded:Connect(
    function()
        if debounce == false then
            local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
            plr:WaitForChild("PlayerGui").Quest1.Frame.Visible = false
        end
    end
)


1 comment

2

I think you could anchor the player character HumanoidRootPart

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.