I know this will be easy but I want to get help. Basically I have this function(well stuff inside a function) here. It works completely but I am unsure on how to end one if statement while keeping another going.
if #_G.getTeam(game.Teams.Survivors) == 0 then -- I want to keep this running if first_infected.StarterGear.Revolver ~= nil then --I want to end this. first_infected.StarterGear.Revolver:Destroy()-- end here _G.infected() game.Workspace.Field1.Parent = game.Lighting wait(3) game.Lighting.Field1.Parent = game.Workspace
So basically where can I put the end to end the second if statement? Do I make sense. Thanks!
You can by ending the code with an 'end', let you show you an example (With a different script);
local Numbers = 5 --This is what we're going to use if Numbers == 5 then --This is our first 'if' statement print("Five! :D") --This will print, well, 'Five! :D' Numbers = 4 --Then this'll change Numbers to 4 if not Numbers == 5 then --If it isn't equal to five print("Not equal to five. :c") --This'll print 'Not equal to five. :c' else --Elseif it is print("Nope :c") --It'll print 'Nope :c' end --This ends the second 'if' statement, or ends the second 'if' coding else --Elseif it isn't print("Nope. :c") --It'll print 'Nope :c' end --This ends the first 'if' statement, or ends the first 'if' coding
If I didn't explain good enough, just let me know and I'll try and explain it better. :) (Sorry, tired today, so sorry if I did corrections, or didn't explain too well) Hope this helped!