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

local player = game.Players.LocalPlayer --Getting our player
repeat wait() until player.Character --Making sure our character has fully loaded
local char = player.Character --After it's loaded it will set this variable
local head = char:WaitForChild('Head') --Getting the head from our character

head.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

local L_1_ = game.Players.LocalPlayer --Getting our player repeat wait() until L_1_.Character --Making sure our character has fully loaded local L_2_ = L_1_.Character --After it's loaded it will set this variable local L_3_ = L_2_:WaitForChild('Head') --Getting the head from our character L_3_.Anchored = true

Answer this question