Advertisement
4zx16

Press R to Respawn (CLIENT) + RemoteEvent Needed

Jan 25th, 2022 (edited)
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. --[[
  2.  || 📜 AUTHOR: @4zx16 || PRESS R TO RESPAWN || ONLY CHANGE THE KEY CODE NOTHING ELSE!
  3. ]]
  4. local UserInputService = game:GetService("UserInputService")
  5. local Respawn = game:GetService("ReplicatedStorage").RE
  6. local TriggerKey = Enum.KeyCode.R
  7.  
  8. UserInputService.InputBegan:Connect(function(key)
  9.    
  10.     if key.KeyCode == TriggerKey then -- If the key is pressed
  11.         Respawn:FireServer() -- Makes the player respawn
  12.     end
  13. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement