Ok. I’ll try that. Thanks for the help!
First, I would not recommend setting ResetOnSpawn for most guis. It can be the cause of many bugs. Keep a single copy of the gui by turning off ResetOnSpawn.
Put this in StarterPlayerScripts
local player = game.Players.LocalPlayer
local lives = player:WaitForChild("Lives")
player.CharacterAdded:Connect(function(char)
local humanoid = char:WaitForChild("Humanoid")
humanoid.Died:Connect(function()
print(player)
if player then
game.ReplicatedStorage.PlayerDied:FireServer(player)
print("Fired!")
else
return nil
end
end)
end)
local MenuGui = player.PlayerGui:WaitForChild("MenuGui")
MenuGui.Frame.PlayButton.MouseButton1Click:Connect(function()
wait(0.216)
MenuGui.Live1.Visible = true
MenuGui.Live2.Visible = true
MenuGui.Live3.Visible = true
print("Lives visible!")
end)
lives:GetPropertyChangedSignal("Value"):Connect(function()
if lives.Value == 2 then
MenuGui.Live3.Image = "rbxassetid://7061951219"
print("Changed!")
end
if lives.Value == 1 then
MenuGui.Live2.Image = "rbxassetid://7061951219"
print("Changed!")
end
if lives.Value == 0 then
MenuGui.Live1.Image = "rbxassetid://7061951219"
print("Changed!")
end
end)
It says that there is an error with StarterGui not being part of Player.
Oops it should be
player.PlayerGui
instead of StarterGui
Now it’s saying that the images aren’t valid members of the GUI.
I don’t know how your gui is set up so you will have to fix those by making the paths equivalent to how they are in the starter gui. Then it will work.
Ok, thanks for your help on this!