Hello! How can I make a script that makes the player not able to move for let’s say 5 seconds while the intro is loading?
Any help will be appreciated!
Hello! How can I make a script that makes the player not able to move for let’s say 5 seconds while the intro is loading?
Any help will be appreciated!
Anchor the player’s character.
Can you explain on how to do that?
local players = game:GetService("Players")
local playerList = players:GetChildren()
task.wait(5) --initial intermission wait
print("Round starting soon...")
for _, player in pairs(playerList) do
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
humanoid.WalkSpeed = 0
humanoid.JumpPower = 0
end
task.wait(10) --wait 10 while round starting
print("Round started!")
for _, player in pairs(playerList) do
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
end
This will freeze every player at the same time for 10 seconds, just an initial script, you should make any changes as you see fit.
if i remember is:
local PlayerModule = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule"))
local Controls = PlayerModule:GetControls()
Controls:Disable()
--Controls:Enable()
require use a localScript
Where does this go? Workspace?
Snipped, ignore this post, thanks.
Yea, I need something that does it to that one person who is loading into the game.
Snipped, ignore this post, thanks.
local player = game.Players.LocalPlayer --Locating the player
local char = player.Character --Locating the player's character
char.HumanoidRootPart.Anchored = true
wait(5)
char.HumanoidRootPart.Anchored = false
Snipped, ignore this post, thanks.
the localscript goes to StarterCharacterScripts
Snipped, ignore this post, thanks.
They all seem to give the same error code
Snipped, ignore this post, thanks.
local players = game:GetService("Players")
local player = players.LocalPlayer or players.PlayerAdded:wait()
local character = player.Character or player.CharacterAdded:wait()
local humanoid = character:WaitForChild("Humanoid")
do
humanoid.WalkSpeed = 0
humanoid.JumpPower = 0
task.wait(10)
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
end
Okay, that worked, thank you much! I appreciate it!
Sorry about that, missed a slight mistake which has been fixed in the most recent post.