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

How to make person's walkspeed 0?

Asked by 5 years ago

I am making a baseball game and ran into a problem I can't fix. So basically, when someone enters the batters box, I want them to have 0 walkspeed. I know that it has to do with the humanoid, but problem is I just dont know how to implement it and I've tried everything. Help would be appreciated

01-- Variables/Other
02local IsBatting = false
03local RH = game.Workspace.PlayerParts.RH
04local LH = game.Workspace.PlayerParts.LH
05-- Camera Stuff
06local Camera = workspace.CurrentCamera
07local TweenService = game:GetService("TweenService")
08local BatterCamera = game.Workspace.MouseIgnores.BatterCamera
09-- Character/Player Stuff
10local Player = game.Players.LocalPlayer
11 
12-- Functions
13 
14function TweenCamera()
15    Camera.CameraType = Enum.CameraType.Scriptable
View all 37 lines...
0
Have you tried game.Players.LocalPlayer.Humanoid.WalkSpeed = 0? hihowareya115 53 — 5y
0
Yes, it says that 'Humanoid is not a valid member of Player' FriendBandsX 14 — 5y
1
oh! My mistake! I meant game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 0 hihowareya115 53 — 5y
0
It works, thanks very much FriendBandsX 14 — 5y
0
np. Accept my answer. hihowareya115 53 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

All you need to do is change the player variable.

1local Player = game.Players.LocalPlayer.Character.Humanoid
2Player.WalkSpeed = 0
Ad

Answer this question