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

cant open a gui after a if?

hello i have a zombie survival game and i want to make after the zombies die a gui to pop up put it doesnt can anyone send me my script but fixed?

script: while wait(1) do if workspace.Zombie:FindFirstChild("LowerTorso") then print("zombies still here") else game.StarterGui.Win.Frame.Visible = true end end

Thanks

8 comments

0

All Zombies Are Named Zombie

0

this doesn't send me anywhere, also why is it 'pastebin', have you copied this code?

0

I honestly don't know what to say about this. You have a perfectly fine text editor here that is designed to handle lua code, and you instead post the code on pastebin and then post the url here? Also, you literally asked us to turn your 2 line script into something usable without giving us any other information.

0

my code: while wait(1) do if workspace.Zombie:FindFirstChild("LowerTorso") then print("zombies still here") else game.StarterGui.Win.Frame.Visible = true end end

0

-1 for saying "can anyone send me my script but fixed?".

0

epic!11!11!!

0

So you got one step closer, now actually use the lua code block... How difficult is this for you to follow simple rules?

0

You need to post where the Zombies die.

2 answers

Simply, instead of checking if the LowerTorso is still in workspace, check if the actual Zombie is still there.

while wait(1) do
	for i,v in pairs(game.Players:GetPlayers()) do
		if workspace:FindFirstChild("Zombie") then
			print("Zombies are still alive")
		else
			print("Wave Defeated!")
			v.PlayerGui.Win.Frame.Visible = true
		end
	end
end

You pretty much do this, but add a RemoteEvent. I'm not going to script your whole script though. Here is a really good tutorial of RemoteEvents.

https://wiki.roblox.com/index.php?title=Remote_Functions_%26_Events

I would do some of your RemoteEvent but I don't know where your scripts are, I need more details.

Hope this helped, if it did. Click the Answer button as it'd be greatly appreciated :D

3 comments

0

my script is normal not local and its on workspace

0

not worked :(

0

my gui dont pop up unless i respawn

my script is normal not local and its on workspace

not worked the gui dont pop up unless i die/respawn

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