Local isScientist = player.Team = game.Teams. Local player = game.Players:GetPlayerFromCharacter(hit.parent) ![]() check if character is not dead and a scientist everything after this point happens once the player was not touching before, so flip the debounce flag escape if this player is already touching the floor wait for a player to join the game :Connect(function(player) - wait for their character to load into the game player.CharacterAdded:Connect(function(character) - yield the thread for but a moment so that the character can finish loading wait() - move their character local targetPosition Vector3.new(500, 5, 50. Local hum = char:FindFirstChild("Humanoid") - Humanoid check that the thing that hit is a player ![]() I would recommend debouncing the connection so that only one loop happens per player : - create a map of players touching the floor What is probably happening is that this event is firing multiple times, and you have a bunch of these repeat-while loops all running at the same time, causing the player's health to drop very quickly. If the player is walking across the floor, it will fire every time the player's foot hits it. You have this callback connected to the Touched event, and the event will fire every time a player touches the part.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |