A simple issue that I can not fix

My brain has given up now, and I can’t get this issue:

with this code:

local Players = game.Players
local GUI = game.ReplicatedStorage.GUI
local LoadCharacterRE = game.ReplicatedStorage.RemoteEvents.LoadCharacter

Players.PlayerAdded:Connect(function(player)
	local active = Instance.new("BoolValue")
	active.Parent = player
	active.Name = "Active"
	local revive = Instance.new("BoolValue")
	revive.Parent = player
	revive.Name = "Revive"
	for i,v in pairs(GUI:GetChildren()) do
		v:Clone().Parent = player.PlayerGui
	end
end)

LoadCharacterRE.OnServerEvent:Connect(function(Player)
	local char = Player.Character
	Player.Active.Value = true
	Player.Revive.Value = false
	Player:LoadCharacter()
	if char then return end
	for i,v in pairs(GUI:GetChildren()) do
		if not Player.PlayerGui:FindFirstChild(v.Name) then
			v:Clone().Parent = Player.PlayerGui
		end
	end
end)

fixed.

As you can see I am just making the guis of the character go in player gui for a menu but I am facing an issue where the menu does not load after one death.
Here is the menu:
image
Now I can not simply make it resetonspawn because doing that would cause issues as whenever I click play the remoteevent “LoadCharacter” fires and thus it will create a loop of menus that keep popping up.

Any Ideas?

Please do not hesitate on askinng me for more information.

1 Like

Nevermind i found a fix that being if humanoid.health is greater than 0 in the menu handler script then ill simply return end it. But I would love to hear everyones ideas! <3

1 Like

Did you bind the death screen to Humanoid.Died? If you simply connect it once, that humanoid will be destroyed and the function won’t be called anymore. I’d suggest putting a death script in StarterCharacterScripts.

1 Like

I know I can do that but it would just look bad overall and I don’t want it to look bad overall.

I know this is not related to your issue, But that looks like an amazing game, Keep it up :+1:

1 Like

Haha yea a lot of people have been saying that… thanks <3

1 Like

yeah I love the way it looks; what is the game exactly? I might play it when it’s done

Well just a simple janky game I am working on to improve my portfolio and improving my modelling capabilities with animation and building. It maybe will be complete?? I hope it will though!

What’s it about though? what do you do?

Zombies… thats what… lol…

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.