Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

cant open a gui after a if?

Asked by 5 years ago
Edited 5 years ago

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

0
All Zombies Are Named Zombie iasonasgamer007 -2 — 5y
0
this doesn't send me anywhere, also why is it 'pastebin', have you copied this code? Ziffixture 6913 — 5y
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. SteamG00B 1633 — 5y
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 iasonasgamer007 -2 — 5y
View all comments (4 more)
0
-1 for saying "can anyone send me my script but fixed?". User#24403 69 — 5y
0
epic!11!11!! lunatic5 409 — 5y
0
So you got one step closer, now actually use the lua code block... How difficult is this for you to follow simple rules? SteamG00B 1633 — 5y
0
You need to post where the Zombies die. TheOnlySmarts 233 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

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

0
my script is normal not local and its on workspace iasonasgamer007 -2 — 5y
0
not worked :( iasonasgamer007 -2 — 5y
0
my gui dont pop up unless i respawn iasonasgamer007 -2 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

my script is normal not local and its on workspace

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

Answer this question