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 » Scripting Helpers
Home Search
 

Re: Simple Script That Should Work

Previous Thread :: Next Thread 
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
06 Jun 2013 03:03 PM
Why doesnt this work?

debounce = false

if debounce = false then
wait(1)
debounce = true
wait()
local c = game.Players.GetChildren()
if #c =< 1 then -- change this after testing
for i = 1, #c do
if c[i].Character.TeamColor = "Bright Blue"
then c[i].Character.Torso.CFrame = CFrame.new(-280, 393.2, 160.5)
elseif c[i].Character.TeamColor = "Bright Red"
then c[i].Character.Torso.CFrame = CFrame.new(-12, 393.2, -104.5)
wait(180)
c[i].Character.Torso.CFrame = CFrame.new(-189, 572.2, 18)
end
end
end

wait(1)

debounce = false

end

Output:
16:04:45.872 - Workspace.Script:3: 'then' expected near '='
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
06 Jun 2013 03:03 PM
debounce = false

if debounce == false then --Need to '=' signs. It means 'is equal to'.
wait(1)
debounce = true
wait()
local c = game.Players.GetChildren()
if #c =< 1 then -- change this after testing
for i = 1, #c do
if c[i].Character.TeamColor = "Bright Blue"
then c[i].Character.Torso.CFrame = CFrame.new(-280, 393.2, 160.5)
elseif c[i].Character.TeamColor = "Bright Red"
then c[i].Character.Torso.CFrame = CFrame.new(-12, 393.2, -104.5)
wait(180)
c[i].Character.Torso.CFrame = CFrame.new(-189, 572.2, 18)
end
end
end

wait(1)

debounce = false

end
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
06 Jun 2013 03:04 PM
Two*
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
06 Jun 2013 03:05 PM
Next error message:

16:08:18.948 - Workspace.Script:8: 'then' expected near '='
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
06 Jun 2013 03:05 PM
debounce = false

if debounce == false then --Needs to '=' signs.
wait(1)
debounce = true
wait()
local c = game.Players:GetChildren() --This is a method, not a property or child.
if #c <= 1 then -- change this after testing
for i = 1, #c do
if c[i].Character.TeamColor = "Bright blue" then
c[i].Character.Torso.CFrame = CFrame.new(-280, 393.2, 160.5)
elseif c[i].Character.TeamColor = "Bright red" then
c[i].Character.Torso.CFrame = CFrame.new(-12, 393.2, -104.5)
wait(180)
c[i].Character.Torso.CFrame = CFrame.new(-189, 572.2, 18)
end
end
end

wait(1)

debounce = false

end
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
06 Jun 2013 03:06 PM
I fixed a LOT of simple errors in the one above.
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
06 Jun 2013 03:08 PM
Thanks for seeing that but it wasnt creating the error
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
06 Jun 2013 03:24 PM
Oops, forgot to fix those.

debounce = false

if debounce == false then --Needs to '=' signs.
wait(1)
debounce = true
wait()
local c = game.Players:GetChildren() --This is a method, not a property or child.
if #c <= 1 then -- change this after testing
for i = 1, #c do
if c[i].Character.TeamColor == "Bright blue" then
c[i].Character.Torso.CFrame = CFrame.new(-280, 393.2, 160.5)
elseif c[i].Character.TeamColor == "Bright red" then
c[i].Character.Torso.CFrame = CFrame.new(-12, 393.2, -104.5)
wait(180)
c[i].Character.Torso.CFrame == CFrame.new(-189, 572.2, 18)
end
end
end

wait(1)

debounce = false

end
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
06 Jun 2013 03:41 PM
This is my finished product. It still doesn't work but it does not show any messages in the output. Now whats the problem?

debounce = false

if debounce == false then
wait()
debounce = true
wait()
local c = game.Players:GetChildren()
if #c <= 1 then -- change this after testing
for i = 1, #c do
if c[i].TeamColor == "Deep Blue" then
c[i].Character.Torso.CFrame = CFrame.new(-280, 393.2, 160.5)
elseif c[i].TeamColor == "Bright Red"
then c[i].Character.Torso.CFrame = CFrame.new(-12, 393.2, -104.5)
wait()
c[i].Character.ForceField:Remove()
wait(180)
c[i].Character.Torso.CFrame = CFrame.new(-189, 572.2, 18)
game.Lighting.ForceField:Clone().Parent = c[i].Character
end
end
end

wait(1)

debounce = false

end
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
06 Jun 2013 03:59 PM
bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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