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

An "If Statement"? (on my real account)

Fight4money is here again! I yet again have a question about my to-be popular game called BLOX Halloween. Here it is: http://web.roblox.com/BLOX-Halloween-place?id=178897794 So, i want to add an if statement in the MainGameScript. So, i have a round in which there are players and a pathfinding ghoul in the map. I want it so when the players have all died, a gui would pop up saying that the ghoul won (i have the GUI) If there are still players left after the time limit, gui to pop up saying that the players won (i have this GUI too) This the snippet of code for that round, please say what I should add ti it to do this:

game.StarterGui.GameaGUIs.StatusTitle.Text = "Intermission"
wait (10)
game.StarterGui.GameaGUIs.StatusTitle.Text = "Game Chosen: Survive The Ghoul!"
wait (2)
game.Lighting.GhoulMap:clone().Parent = game.Workspace
wait (5)
target = CFrame.new(897, 755, -50)

wait(2)

for i, player in ipairs(game.Players:GetChildren()) do
	player.Character.Torso.CFrame = target + Vector3.new(0, i * 5, 0)
end
game.Lighting.GlobalShadows = true
game.Lighting.TimeOfDay = "00:00:00"
wait (200)
game.Workspace.GhoulMap:Destroy()

THE GAME WORKS I just need an if statement as said above.

6 comments

0

By the way I have everything I mentioned except an "if" statement.

2

First of all, nobody knows who you are. Second, why are you asking when you seem to know what you need to do?

0

Because i do not know how to do it, please do not be disrespectful in this wiki.

2

An if statement should be easy enough looking at your level of script that you show us. If you think about it, it's not that hard.

1

You say sound like you are famous and that you will be famous.. When you cant add an if statement? If you cant script you cant get famous, the end. Don't just think your great and better than everyone else.

1

I put a moderation on this question for the Poster's protection due to the great deal of unsupportive reputation. I ask others who have community moderation privileges do the same as well. Thank you.

1 answer

✓ Accepted answer
if (condition) then
	-- code
end

Also try the wiki article.

2 comments

1

I think this answer sums it up perfectly.

0

thanks

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