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

Can I make a Lock player Position Function?

Asked by 7 years ago

hey. I have been working on my game for a while and i had an idea. in the beginning a text gui is talking to a player. Is there any way i can lock the players position while the message is going. The following Script is just a guess to show what i mean:

game.Player.LocalPlayer.JoinedGame:connect(function(LockplrCords)
wait(30)
game.Players.LocalPlayer:disconnect(function(LockplrCords)

Forgive my noobiness, but can someone show me how to do this?

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

You could anchor the player in the position.

for i, v in pairs(LocalPlayer.Character:GetChildren()) do -- get all of the items inside the player's character model
    if v:IsA("BasePart") and v.Anchored == false do -- make sure the item is a part (not clothing or scripts)
        v.Anchored = true -- anchor the item
    end
end)

I wrote that with no testing but it should work. I have explained what each line does so that you get a breakdown if anything goes wrong.

Please accept my answer if I helped!

1
You only need to anchor humanoid root part Vulkarin 581 — 7y
Ad

Answer this question