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

Step on to Unanchor a part?

So i am trying to make a game where in a certain part the floor falls no disapear fall. this is what i currently have also i want this to not be in one client i want this to be for everyone.

Part = script.Parent

Part.Touched:Connect(function(hit)

Part.Anchored = false

end)

1 comment

0

is it a local script?

2 answers

✓ Accepted answer

If you want this to only work if a leg touches it then we can do as follows:

Part = script.Parent

Part.Touched:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) -- this just checks if a player exists
if player then 
	if hit.Name == "Left Leg" or hit.Name = "Right Leg" then
		Part.Anchored = false
	end
end

end)

Everything is good here, so I don't understand the problem. You could add a wait() if you want to give the players some time to get off. Also to reduce lag I would check if it is anchored already. Here is the improved script.

Part = script.Parent

Part.Touched:Connect(function(hit)
If Part.Anchored == true then
wait(1)
Part.Anchored = false
end)

Let me know what the problem is and I can help furthermore, have a good day!

2 comments

0

This script is wrong

0

Make sure you use if not If and you need to check whatever hits has a humanoid, lastly make your you reference player object and the parameter but

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