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

How to Anchor player?

Asked by 8 years ago

How doi anchor a player's Head From a local script from PlayerGui

2 answers

Log in to vote
1
Answered by
StoIid 364 Moderation Voter
8 years ago

Simple enough. You would simply just create a LocalScript and put this script inside a gui, or just in the game.StarterGui instance as is.

The Code With Helpful Notes

1local player = game.Players.LocalPlayer --Getting our player
2repeat wait() until player.Character --Making sure our character has fully loaded
3local char = player.Character --After it's loaded it will set this variable
4local head = char:WaitForChild('Head') --Getting the head from our character
5 
6head.Anchored = true --Making the characters head, anchored.

Hope this helped! If this answered your question please accept my answer!

1
That's too complicated. Lua is hard :/ User#11440 120 — 8y
Ad
Log in to vote
0
Answered by 8 years ago
1local L_1_ = game.Players.LocalPlayer --Getting our player
2repeat
3    wait()
4until L_1_.Character --Making sure our character has fully loaded
5local L_2_ = L_1_.Character --After it's loaded it will set this variable
6local L_3_ = L_2_:WaitForChild('Head') --Getting the head from our character
7 
8L_3_.Anchored = true

Answer this question