#Movement Help

1 messages · Page 1 of 1 (latest)

true edge
#
heady cosmos
#

Heyy here:
Here’s how you can "pause" gameplay while in the shop:

-- When entering the shop
game.ReplicatedStorage.InShop.Value = true
player.Character.Humanoid.AutoRotate = false
game.StarterGui.GameplayGui.Enabled = false -- Hides coins/score GUI
game.Workspace.ObstaclesFolder:SetAttribute("Active", false) -- Custom toggle for obstacles

-- Optional: Lock movement to left/right
local controller = player:FindFirstChild("ControllerScript")
if controller then
controller.Enabled = false -- Disable main movement
end
-- Add a script that allows only left/right movement here

-- When exiting the shop
game.ReplicatedStorage.InShop.Value = false
player.Character.Humanoid.AutoRotate = true
game.StarterGui.GameplayGui.Enabled = true
game.Workspace.ObstaclesFolder:SetAttribute("Active", true)

if controller then
controller.Enabled = true
end

💡 Tips:

Use BoolValue or attributes to check InShop status.

Wrap your obstacle scripts with:

if workspace.ObstaclesFolder:GetAttribute("Active") then
-- do stuff
end


That’s the basics to pause gameplay cleanly while still letting the player browse the shop. You can customize the movement limits with context actions or input controls 👌

edgy sailBOT
#

studio** You are now Level 1! **studio

fast canopy
heady cosmos
#

Hey! 👋 Nah, this should go in a LocalScript, not ServerScriptService.
Since it’s about pausing gameplay for the player (like when they open the shop), it needs to run on the client.
So you can put the LocalScript inside something like:
StarterPlayer > StarterPlayerScripts or StarterGui depending on your setup.
Lmk if you want help wiring it up 💪

fast canopy
#

well i have a button on the gui which will teleport to the shop so would i just put a local script in the button