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

How do i make players respawn with a key?

How can i make people who play the game respawn with a key?

Example: Someone is playing, and then he wanted to respawn. How can i make this player respawn when he presses the R key?

2 answers

✓ Accepted answer

I explained it the best I could, put this script in StarterGui or StarterPack.

-- Variables
local player = game.Players.LocalPlayer -- Now you can refer to the player
local mouse = player:GetMouse() -- Now you can refer to the mouse

-- Main script
mouse.KeyDown:connect(function(Key) -- When they press a key
	local key = string.lower(Key) -- So if they use caps, there might be a easier way
	if key == "r" then -- If the lower key is r
		player:LoadCharacter() -- Respawn them
	end -- End the if function
end) -- End the function

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