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: Help error on line 6

Previous Thread :: Next Thread 
ThraxPain is not online. ThraxPain
Joined: 14 Sep 2014
Total Posts: 183
05 Jul 2015 04:45 PM
local c = game.Players:GetChildren()
while true do
wait(10)


if c.leaderstats.Job.Value = "Citizen" then
c.leaderstats.Salary.Value = 50
end
wait()
end
Report Abuse
magicalandre13 is not online. magicalandre13
Joined: 21 Jan 2011
Total Posts: 5327
05 Jul 2015 04:46 PM
Use double equals(if c.leaderstats.Job.Value == "Citizen" then)
Report Abuse
ThraxPain is not online. ThraxPain
Joined: 14 Sep 2014
Total Posts: 183
05 Jul 2015 04:47 PM
The script still doesnt work.
Report Abuse
mycheeze is not online. mycheeze
Joined: 27 Jun 2011
Total Posts: 6748
05 Jul 2015 04:47 PM
while wait(10) do
for _,_ in next, game.Players:GetPlayers() do
if _:FindFirstChild'leaderstats' and
_.leaderstats.Job.Value = 'Citizen' then
_.leaderstats.Salary.Value = 50
end
end
end
Report Abuse
ThraxPain is not online. ThraxPain
Joined: 14 Sep 2014
Total Posts: 183
05 Jul 2015 04:49 PM
Did not fix
Report Abuse
ThraxPain is not online. ThraxPain
Joined: 14 Sep 2014
Total Posts: 183
05 Jul 2015 04:51 PM
bump
Report Abuse
magicalandre13 is not online. magicalandre13
Joined: 21 Jan 2011
Total Posts: 5327
05 Jul 2015 04:53 PM
local c = game.Players:GetPlayers()
while true do
wait(10)
for i,v in pairs(c)
local ls = v:WaitForChild("leaderstats")
if ls.Job.Value == "Citizen" then
ls.Salary.Value = 50
end
wait()
end
Report Abuse
ThraxPain is not online. ThraxPain
Joined: 14 Sep 2014
Total Posts: 183
05 Jul 2015 04:58 PM
error on line 5
Report Abuse
magicalandre13 is not online. magicalandre13
Joined: 21 Jan 2011
Total Posts: 5327
05 Jul 2015 04:59 PM
local ls = v.leaderstats
Report Abuse
ThraxPain is not online. ThraxPain
Joined: 14 Sep 2014
Total Posts: 183
05 Jul 2015 05:00 PM
Local expected "do" got "local"
Report Abuse
magicalandre13 is not online. magicalandre13
Joined: 21 Jan 2011
Total Posts: 5327
05 Jul 2015 05:02 PM
local c = game.Players:GetPlayers()
while true do
wait(10)
for i,v in pairs(c)do
local ls = v:WaitForChild("leaderstats")
if ls.Job.Value == "Citizen" then
ls.Salary.Value = 50
end end
wait()
end
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
05 Jul 2015 05:42 PM
for i,v in next, game.Players:GetPlayers() do
local stats = v:FindFirstChild("leaderstats")
local job = stats:FindFirstChild("Job")
local salary = stats:FindFirstChild("Salary")
if stats and job and salary then
if job.Value == "Citizen" then
salary.Value = 50
end
end
end


"Talk is cheap. Show me the code." - Linus Torvalds
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
05 Jul 2015 05:43 PM
btw it would just be better to handle this client sided. It would make it easier because you can just add a .Changed event on job.


"Talk is cheap. Show me the code." - Linus Torvalds
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