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

How do I lock the Character and camera so that it will stop moving?

Asked by 9 years ago
players = game.Players
player = game.Players.LocalPlayer
character = player.Character
hum = character.Humanoid
cam = game.Workspace.CurrentCamera
function PlayerSetup()
    while true do
        hum.WalkSpeed = 0
        wait(.01)
    end
end
players.PlayerAdded:connect(PlayerSetup)

1 answer

Log in to vote
1
Answered by
dyler3 1510 Moderation Voter
9 years ago

You could always just anchor the Torso, then make the Camera's CameraType 'Scriptable'.


Here's a quick edit of your code with that added in:

players = game.Players
player = game.Players.LocalPlayer
character = player.Character
hum = character.Humanoid
cam = game.Workspace.CurrentCamera

function PlayerSetup()
    while true do
        Character.Torso.Anchored = true
        cam.CameraType = "Scriptable"
        wait()
    end
end

players.PlayerAdded:connect(PlayerSetup)

And there you go, that's it.


If you have any further problems/questions, please leave a comment below, and I'll see what I can do. Hope I helped :P

0
should i do this in a local script WeBuiltOurOwnWorld 6 — 9y
0
Yes. And make sure it's a decendent of the Player in some way. dyler3 1510 — 9y
0
should i put into the starter pack WeBuiltOurOwnWorld 6 — 9y
0
I would put it into StarterGui dyler3 1510 — 9y
View all comments (3 more)
0
also theres now an issue when i use the A and D keys the movement comes back WeBuiltOurOwnWorld 6 — 9y
0
scratch that. When i right click the movmemnt comeback WeBuiltOurOwnWorld 6 — 9y
0
The camera movement, or the player movement? dyler3 1510 — 9y
Ad

Answer this question