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: Help with a few simple chunks of code?

Previous Thread :: Next Thread 
tuxedoman23 is not online. tuxedoman23
Joined: 24 Apr 2009
Total Posts: 4670
01 Feb 2013 06:28 PM
(Part one of a script)

local guests = game.Players:GetPlayers()
for i = 1, #guests do
if v ~= nil then
if guests.Character.TeamColor == BrickColor.new("Bright red") then
guests.leaderstats.Points.Value = guests.leaderstats.Points.Value + 20 --20 extra points to winners
end
else
guests.leaderstats.Points.Value = guests.leaderstats.Points.Value + 10 --10 extra points to losers
end
end

(Part two of a script; this part comes after the first part)

local gscript = game.Workspace:findFirstChild("Game script")
while wait() do
if gscript.Disabled == false then return end
end
else
gscript.Disabled = false
end



The output says that I have misplaced, not added, or added too many ends. I tried to detect the problem, but I could not. However, I believe the problem lies somewhere in these two parts of my script, since the script operated fine before those two parts.
Report Abuse
Inordinatus is not online. Inordinatus
Joined: 24 Dec 2012
Total Posts: 155
01 Feb 2013 06:32 PM
local guests = game.Players:GetPlayers()
for i = 1, #guests do
if v ~= nil then


What is v?

ιησя∂ιηαтυѕ
Report Abuse
Usering is not online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
01 Feb 2013 06:35 PM
Didn't define 'v' in the 1st part.

For the first one, you just got confused about where to end; you ended the if statement, used else, did something, then ended the loop.

if gscript.Disabled == false then return
else
gscript.Disabled = false
end
end--end while loop
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