how do i make it so when a player touches a brick they get respawned?
respawn player on touch?
2 answers
The above answer will kill the player. But if you want to make the character instantly respawn without falling apart you would use this:
script.Parent.Touched:Connect(function(hit)
local player = game.Players:FindFirstChild(hit.Parent.Name)
if player then
player:LoadCharacter()
end
end)
Hopefully that worked out for you. If you liked this answer please thumbs up and accept as your answer.
All the best,
PrismaticFruits - obviously a very talented scripter
3 comments
Yep, was about to comment the same answer. Def a better way to do this than hasanchik's answer.
Edited and tested it in game. This will work now. How Prismatic had it before didn't quite work, but almost worked. He needed to check if the thing touching the part was a player. If it was a player then you have to call player's loadCharacter function. He was trying to call the LoadCharacter function on the part that was touching the script.Parent
I am confused, do I use LoadCharacter on a character or player?
You are just asking for a kill brick script:
--Variables--
local Brick = script.Parent
--End--
--Code--
local function PlayerTouched(Part)
local Parent = Part.Parent
if game.Players:GetPlayerFromCharacter(Parent) then
Parent.Humanoid.Health = 0
end
end
Brick.Touched:connect(PlayerTouched)
1 comment
After you insert this script, you should go to players and set respawn time to 0
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Player:LoadCharacter()