yes, there is! you will need a GUI! If the player pressed the button they will respawn (with killing) and then dicrease the Death or WOs value by 1!
else you have to use a CFrame
okay, here is the script (please make a Gui for that)
2 | Menu = script.Parent.Parent |
5 | Button.MouseButton 1 Down:connect( function () |
6 | script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 |
7 | script.Parent.Parent.Parent.Parent.Parent.leaderstats.Deaths.Value = script.Parent.Parent.Parent.Parent.Parent.leaderstats.Deaths.Value - 1 |
Change Deaths to WOs if you want!
script.Parent.Parent.Parent.Parent.Parent this let the script (just a normal script) look to game.Players.LocalPlayer
game.Players.LocalPlayers can only be used in a "LocalScript"
But many people like normal scripts most..
If you want to use a CFrame use this:
btw, I didn't tested this but just typed it in here, if it doesn't work please tell me :( don't give me a -1
1 | local Spawn = game.Workspace.SpawnBrick |
3 | Menu = script.Parent.Parent |
5 | Button.MouseButton 1 Down:connect( function () |
6 | script.Parent.Parent.Parent.Parent.Parent.Character.Position = CFrame.new(Spawn.Postition) |