I was recently making a Roblox game called "The nutcracker". in Roblox, The only problem is when I was making a death screen I already know how to make a "Back to lobby" button,
local TeleportService = game:GetService("TeleportService")
local Place = Place id here
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
TeleportService:Teleport(Place, player)
end)
But the problem is I don't know how to make a respawn button. Please Help!
Many Thanks, Cyber_gamer91 Game link here! https://web.roblox.com/games/4451993957/The-Nutcracker
You need to make a ScreenGui and insert a text button. Add a script and use the following code:
function m1down() script.Parent.Parent.Parent.Parent:LoadCharacter() end script.Parent.MouseButton1Down:connect(m1down)
If you want to know how to load the gui when the player dies, let me know
Make a Text Button in a Screen GUI and put this inside a local script inside the Text Button:
script.Parent.MouseButton1Click:Connect(function(player) local char = game.Players.LocalPlayer char:LoadCharacter() end)
If this helped please accept this answer.
UI should not be touched by the server. Use FireServer() instead.
Learn more about remotes here.