Hey peeps. So I've been having some trouble anchoring a player once the text button is clicked. I've tried using this script:
local part = script.Parent
local db = false
part.MouseButton1Click:Connect(function(clicked)
local human = clicked.Parent:findFirstChild("Humanoid")
if human then
db = true
human.Parent.UpperTorso.Anchored = true
wait(20)
human.Parent.UpperTorso.Anchored = false
end
end)
But it doesn't work. The output says:
Players.Paradoa.PlayerGui.MainMenu.TextButton.LocalScript:5: attempt to index nil with 'Parent'

2 comments
Why did you unaccept my answer? Do you need anything else?
I added more comments to explain better.