RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make it so a variable determinates to run anchorcharacter or not"
local player = game:GetService("Players").LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local shouldAnchor = true -- Change this variable to control whether the character should be anchored local function anchorCharacter() if character:FindFirstChild("HumanoidRootPart") then if shouldAnchor then character.HumanoidRootPart.Anchored = true else character.HumanoidRootPart.Anchored = false end else print("HumanoidRootPart not found in character") end end anchorCharacter() -- Call the function to apply the anchoring based on the shouldAnchor variable