generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Challenge. (Complicated) Help

Previous Thread :: Next Thread 
SirIngenuity is not online. SirIngenuity
Joined: 06 Oct 2012
Total Posts: 3149
11 Jun 2015 06:53 PM
local players = game.Players:GetPlayers()

while true do
wait()
if game.Workspace.Ball.Position.X == 27
and
for i=1, #players do
if players[i].TeamColor==BrickColor.new("Black") then
if players[i].Character.Torso.Position.X>27 then
print("Hi")
end
end
end
end
end

Output:
17:53:30.424 - Workspace.Script:7: unexpected symbol near 'for'
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
11 Jun 2015 06:55 PM
"and"

This has no place in this script.
Report Abuse
EncodedLua is not online. EncodedLua
Joined: 02 May 2012
Total Posts: 1555
11 Jun 2015 06:55 PM
After the if statement after wait() you put and instead of then.
Report Abuse
SirIngenuity is not online. SirIngenuity
Joined: 06 Oct 2012
Total Posts: 3149
11 Jun 2015 06:56 PM
Yes.

Its suppose to run if the ball x position is 27 AND black team players have greater value then 27 it prints Hi
Report Abuse
SirIngenuity is not online. SirIngenuity
Joined: 06 Oct 2012
Total Posts: 3149
11 Jun 2015 06:57 PM
encoded what?
Report Abuse
seliso is online. seliso
Joined: 30 Jan 2011
Total Posts: 6443
11 Jun 2015 06:59 PM
while true do
wait()
if game.Workspace.Ball.Position.X == 27 then
for i=1, #players do
if players[i].TeamColor==BrickColor.new("Black") then
if players[i].Character.Torso.Position.X>27 then
print("Hi")
end
end
end
end
end
Report Abuse
EncodedLua is not online. EncodedLua
Joined: 02 May 2012
Total Posts: 1555
11 Jun 2015 07:00 PM
I said you put "and" instead of "then"
Report Abuse
SirIngenuity is not online. SirIngenuity
Joined: 06 Oct 2012
Total Posts: 3149
11 Jun 2015 08:56 PM
It doesn't make the daily value turn offsides

local players = game.Players:GetPlayers()

while true do
wait()
if game.Workspace.Ball.Position.X == 27 then
for i=1, #players do
if players[i].TeamColor==BrickColor.new("Black") then
if players[i].Character.Torso.Position.X>27 then
game.Workspace.display.Value = "Offsides"
end
end
end
end
end

Output:
19:55:01.772 - httpGet http://ecsv2.roblox.com/studio/e.png?sessionID=41264af8-5f0c-480f-bc66-24d1e537ba95&userID=32973097&placeID=95206881&event=Action&action=simulationPlayAction&label=none&value=0 failed. Trying again. Error: HTTP 400 (HTTP/1.1 400 Target and EventType parameters are required). Elapsed time: 0.161702
19:55:09.097 - httpGet http://ecsv2.roblox.com/studio/e.png?sessionID=41264af8-5f0c-480f-bc66-24d1e537ba95&userID=32973097&placeID=95206881&event=Action&action=viewOutputWindowAction&label=none&value=0 failed. Trying again. Error: HTTP 400 (HTTP/1.1 400 Target and EventType parameters are required). Elapsed time: 0.14095
19:55:09.116 - httpGet http://ecsv2.roblox.com/studio/e.png?sessionID=41264af8-5f0c-480f-bc66-24d1e537ba95&userID=32973097&placeID=95206881&event=Action&action=viewOutputWindowAction&label=none&value=0 failed. Trying again. Error: HTTP 400 (HTTP/1.1 400 Target and EventType parameters are required). Elapsed time: 0.137843
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
11 Jun 2015 09:10 PM
You see the logic in this script is saying that...if x and if ...you can't have two if statement's in 1 if-block, because "then" is not there


if game.Workspace.Ball.Position.X == 27 -- first if' statement
and -- and statement, continues if-block
for i=1, #players do -- um... for's can be used a contrast statement?
if players[i].TeamColor==BrickColor.new("Black") then -- 2nd' if statement, missing first then
if players[i].Character.Torso.Position.X>27 then
print("Hi")
end
end
end
end
end


Report Abuse
SirIngenuity is not online. SirIngenuity
Joined: 06 Oct 2012
Total Posts: 3149
11 Jun 2015 09:21 PM
local players = game.Players:GetPlayers()

while true do
wait()
for i=1, #players do
if players[i].TeamColor==BrickColor.new("Black") and players[i].Character.Torso.Position.X>27 and game.Workspace.Ball.Position.X == 27 then
game.Workspace.display.Value = "Offsides"
end
end
end

still get the same error
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image