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)
If you want this to only work if a leg touches it then we can do as follows:
01 | Part = script.Parent |
02 |
03 | Part.Touched:Connect( function (hit) |
04 | local player = game:GetService( "Players" ):GetPlayerFromCharacter(hit.Parent) -- this just checks if a player exists |
05 | if player then |
06 | if hit.Name = = "Left Leg" or hit.Name = "Right Leg" then |
07 | Part.Anchored = false |
08 | end |
09 | end |
10 |
11 | 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.
1 | Part = script.Parent |
2 |
3 | Part.Touched:Connect( function (hit) |
4 | If Part.Anchored = = true then |
5 | wait( 1 ) |
6 | Part.Anchored = false |
7 | end ) |
Let me know what the problem is and I can help furthermore, have a good day!