I'm still a novice scripter, so I don't know too much about scripting well
So I've successfully made a TextButton that when you click it, it:
- waits 5 seconds to prevent from leaving too quickly
- teleports you to spawn
- gives you certain set of tools
- changes your health and maxhealth
So all of that works.
The main problem is, if you reset, all of your stuff is gone, and you'd have to go through the whole process again
The script is
textButton = script.Parent
spawns = {game.Workspace.SpawnLocation1 , game.Workspace.SpawnLocation2 , game.Workspace.SpawnLocation3 , game.Workspace.SpawnLocation4}
player = script.Parent.Parent.Parent.Parent
Trowel = game.ReplicatedStorage.ClassicTrowel:Clone()
textButton.MouseButton1Down:connect(function()
wait(5)
player.Character:MoveTo(spawns[math.random(1, #spawns)].Position)
player.Character.Humanoid.MaxHealth = 200
player.Character.Humanoid.Health = 200
Trowel:Clone().Parent = player.Backpack
end)
Thanks for reading! (I'm constantly editing since I'm new to Scripting Helpers)

1 comment
Can you read the entire post please, because I said that it gives different health and TOOLS, When I tried in both script and local script it didn't work. I also did it with playerGUI and player and that didn't work either