Hello everyone! I’m trying to make a main menu for my game, which works perfectly fine, but i don’t want the player to move while it’s in it.
Here’s my idea for the script:
local player = game.Players.LocalPlayer
local character = player.Character
local camera = workspace.CurrentCamera
local playername = player.Name
local humanoid = game.Workspace:WaitForChild(playername):WaitForChild(“humanoid”)
The script only needs to find the humanoid of the local player. i can continue from that.
For retrieving the player Humanoid, you got the ideas down, you just have to wait for a few things and re-check your capitalization.
local player = game.Players.LocalPlayer
repeat task.wait() until player.Character
local character = player.Character
local camera = workspace.CurrentCamera
local humanoid = character:WaitForChild("Humanoid")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local Hum = character:WaitForChild("Humanoid")
Hum.WalkSpeed = 0 -- wdym its hard
Don’t listen to the people being rude. Most things are difficult if you don’t know how to do them. Here’s what I do:
-- bool = true: player can't move
function stopPlayerMovement(bool)
local controls = require(game:GetService("Players").LocalPlayer.PlayerScripts.PlayerModule):GetControls()
if bool then
controls:Disable()
else
controls:Enable()
end
end
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local playername = player.Name
local camera = workspace.CurrentCamera