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

Can someone show me a better way to use this script?

Asked by
Irvene 5
10 years ago

I need it bugless, so I'm asking if someone could help me out here, by showing me if there's any bugs and fixing them possibly.

Script:

01A = game.Players
02 
03if A.NumPlayers == 1 then print("There's not enough players in the game for the game to start.")
04A2 = "Welcome to the official meadows sfing game"
05A4 = "5"
06A3 = "The amount of players is successful, and the game will be starting in" .. A4 .. "Seconds.."
07A4 = "Teaming players..."
08 
09 
10elseif not NumPlayers < 1 then
11    print(NumPlayers.." Is the amount of players in the game.")
12    wait(0.1)
13    if A.NumPlayers == NumPlayers >2 then
14    print("Success")
15    wait(3)
View all 63 lines...

1 answer

Log in to vote
2
Answered by 10 years ago

Many problems here, I'll list them out.

1) You set the A4 value to two different things.

2) Instead of "elseif not Numplayers > 1" use "elseif A.NumPlayers > 1". Also ,you didn't set that to "A.NumPlayers".

3) You haven't set the NumPlayers variable in the script, so right now it means nothing. Set NumPlayers to A.NumPlayers.

4) The while true do loop on line 19 will make sure that nothing after it runs. Also, that part seems pretty useless, it would constantly have a message on the screen. And you forgot to add an end to that while loop.

5) You haven't set the clones to anything, unless you don't have another part of the script included.

6) SpectatorColor has not been set to anything. Instead, replace line 36 with this:

1if player.TeamColor == game.Teams.Spectators.TeamColor then

7) No end to the if statement on lines 40-43.

8) Line 48 is... strange. That wouldn't work at all, if you want to set BlueTeam as a variable, equal to the Blue Team's TeamColor, then use something like this:

1BlueTeam = game.Teams.BlueTeam.TeamColor

9) You got the variable wrong on line 50, it's not "BlueTeamColor" it's just "BlueTeam".

10) Line 51 is messed up, rather than players = BlueTeamColor + 1, use players = players + 1.

11) Also, on line 56, you're printing that the red team has won even if there are players left on the blue team. You should probably add the red team to the loop you created there.

12) And finally, you have no connection lines. This mean that your functions will never run, unless you call them.

I won't write the code for you, but take into account what I said, and be more careful when you're coding next time. Hope I helped!

Ad

Answer this question