Hi, I'm making an obby and I want to make it so if you fall you get respawned instantly when you touched the part that has the script
This isn't a request site, but I'm feeling nice right now. First, we'll make use of the Touched
event in a server script. This assumes that you have a server script inside a part in the workspace:
local part = workspace.Part part.Touched:Connect(function(hit) local plr = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) if plr then plr:LoadCharacter() end end)
We use the :GetPlayerFromCharacter()
method to find the character's player, and then load the character from there, which respawns the character.