Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i make a gui that will show after killing an enemy?

Yeah, i asked a similar question a several hours ago, but it didnt worked that time too tbh. Anyway, heres the script local enemyleader = game.ReplicatedStorage.enemyleader1 game.Workspace.spawner1.Touched:Connect(function() enemyleader.Parent = workspace if game.Workspace.enemyleader1.Humanoid.Health < 0 then game.StarterGui.KILLALLENEMIES.Enabled = true end end) The thing about spawning the enemy works, but the gui doesnt show up. Halp.

1 answer

✓ Accepted answer

You're mixing up StarterGui and PlayerGui. StarterGui is the server copy of a gui that is cloned to new players (or respawning characters). PlayerGui is a child of the player object, so you have to access the gui in the player and enable it there.

The simplest way is to iterate through players like so:

for _,player in pairs(game.Players:GetPlayers()) do
	player.PlayerGui.KILLALLENEMIES.Enabled = true
end

1 comment

0

Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.