I'm currently making a plane, so I don't want to use Admin all the time for freeze myself in the plane. How do I make a script that freezes the person? This must prevent the whole plane from moving Thx for the help!
First of all, this is a request. You should try by yourself first. But, I wanna help out anyway. Now, you're not being very descriptive. So I'll assume, that you want to freeze the player when, let's say he touches a part.
local part = script.Parent local db = false function freeze(hit) local human = hit.Parent:FindFirstChild("Humanoid") if human then -- checks if a human touched it if not db then db = true -- turns debounce on to prevent repetition of the script human.Parent.Torso.Anchored = true -- This is one way to freeze the player. Another way is "human.Parent.WalkSpeed = 0" end end end -- They look nice beside each other, don't you think? part.Touched:connect(freeze)--uses touch event.
This script is put in the part you want to be touched. Hope this helped! If it did, please don't forget to accept my answer. If you have any questions, feel free to comment!
Fix to Peeshavee's script, his only freezes the torso.
local part = script.Parent local db = false function freeze(hit) local human = hit.Parent:FindFirstChild("Humanoid") if human then -- checks if a human touched it if not db then db = true -- turns debounce on to prevent repetition of the script human.Parent.Torso.Anchored = true human.Parent.Head.Anchored = true human.Parent.Left Leg.Anchored = true human.Parent.Left Arm.Anchored = true human.Parent.Right Arm.Anchored = true human.Parent.Right Leg.Anchored = true end end end -- They look nice beside each other, don't you think? part.Touched:connect(freeze)--uses touch event.
To unfreeze, simply just set Anchored to false.