Why Is My Avatar Does Not Fully Resetting Behind Gui?

Hello, I have a gui that allows you to pick your team, and then once picked it will respawn you, but it doesnt seem to fully reset you until the gui is not fully covering the screen, all I do to reset is set the player’s health to 0 I was wondering if anybody knew of any function that I could run that would make the avatar do a full respawn with the gui covering the screen

Can you show me the code? So, just to get this straight, when the player picks a team you want the gui to cover their screen?

No, no, no, so theres a gui, and it lets you pick a team, but heres the thing usually when you reset or humanoid dies, it will bring you back to spawn, but I learned when this gui is fully covering the screen it wont send you back to spawn it will just break off your limbs and stay like that forever, I was wondering if anybody knew of how to fully make it respawn when the gui is fully covering their screen. Something like a function, I am a begginer in lua still so I didn’t know if there was a function of something I didnt know would help fully respawn it

In your properties tab:

ScreenGui > ResetOnSpawn > True

Unless if that’s not what you want?

No, I dont want the gui to respawn, I want the character to respawn when the gui is on their screen the character fully respawns unless the chooseteam is on their screen.

Did you change the player’s spawn time?

Yes I did. I changed it a few times

The spawn time is probably too long. You should check how long it is.

Its 1.5 Seconds I doubt that is the problem.

Ok, check this out then. Player | Documentation - Roblox Creator Hub

Could this be what you need then possibly?

You can also detect whenever the Player’s Character dies, to activate whatever you need here:

--Local Script, not SERVER SCRIPT
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")

Humanoid.Died:Connect(function()
    --Perform your line of codes here
end)

Or I guess a PlayerAdded function would work as well

This looks good, I think this will work, thank you.

1 Like