Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to Anchor player?

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

2 answers

✓ Accepted answer

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 comment

1

That's too complicated. Lua is hard :/


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

This discussion is preserved as it was. New answers, comments, and votes are closed.