I'm a beginner with coding, and I'm willing to always learn. My question is: How do you unanchor a brick or an object when touched? I have tried it and I've probably messed it up big time but here goes nothing.
local Fall = script.Parent function steppedOn() if script.Parent.CheckValue == false then game.Players.Touched:GetPlayerFromCharacter(Fall) script.Parent.Anchored = false else script.Parent.Anchored = true end end Fall.Touched:connect(steppedOn)
You can do:
local Fall = script.Parent function steppedOn(hit) if script.Parent.CheckValue == false then hit.Anchored = false --this line makes whatever touched the par (script.Parent) then that part gets unanchored. script.Parent.Anchored = false else script.Parent.Anchored = true end end Fall.Touched:connect(steppedOn)