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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Payment System - Still Broken

Previous Thread :: Next Thread 
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
10 Jul 2011 01:46 PM
I have fixed it half-a way... But now there is no output and i can't work with it anymore, so I need your help now. I marked where it works to.

Here's the script:

while true do wait(60*2)
m = Instance.new("Message", Workspace)
m.Text = "Its Time For Payment... Everyone Who Has A Job Gets 70 Cash, Visitors Get 35 Cash."
wait(4)
m:Remove()
job = game.Workspace.Jobs
for i = 1, #p do --Works till here, all below won't work and this line won't work.
local TC = p[i].TeamColor
if TC == job.Job1 or TC == job.Job2 or TC == job.Job3 then
p[i].leaderstats.Money.Value = p[i].leaderstats.Money.Value + 70
elseif TC == job.Job4 then
p[i].leaderstats.Money.Value = p[i].leaderstats.Money.Value + 35
elseif TC == job.Job5 then
p[i].leaderstats.Money.Value = p[i].leaderstats.Money.Value + 150
end
end
end


Thanks 4 Help!
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
10 Jul 2011 01:47 PM
Title Fix :3
Report Abuse
Shobobo99 is not online. Shobobo99
Joined: 30 Dec 2008
Total Posts: 5754
10 Jul 2011 01:49 PM
while true do wait(60*2)
m = Instance.new("Message", Workspace)
m.Text = "Its Time For Payment... Everyone Who Has A Job Gets 70 Cash, Visitors Get 35 Cash."
wait(4)
m:Remove()
job = game.Workspace.Jobs
for i = 1, #p do --Works till here, all below won't work and this line won't work.
local TC = p[i].TeamColor
if TC == job.Job1 or TC == job.Job2 or TC == job.Job3 then
p[i].leaderstats.Money.Value = p[i].leaderstats.Money.Value + 70
elseif TC == job.Job4 then
p[i].leaderstats.Money.Value = p[i].leaderstats.Money.Value + 35
elseif TC == job.Job5 then
p[i].leaderstats.Money.Value = p[i].leaderstats.Money.Value + 150
end
end
end

Is "p" a defined table? Is job.Job1 a BrickColor value?
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
10 Jul 2011 01:49 PM
You never defined p :P

while true do wait(60*2)
m = Instance.new("Message", Workspace)
m.Text = "Its Time For Payment... Everyone Who Has A Job Gets 70 Cash, Visitors Get 35 Cash."
wait(4)
m:Remove()
job = game.Workspace.Jobs
p = game.Players.GetPlayers()
for i = 1, #p do --Works till here, all below won't work and this line won't work.
local TC = p[i].TeamColor
if TC == job.Job1 or TC == job.Job2 or TC == job.Job3 then
p[i].leaderstats.Money.Value = p[i].leaderstats.Money.Value + 70
elseif TC == job.Job4 then
p[i].leaderstats.Money.Value = p[i].leaderstats.Money.Value + 35
elseif TC == job.Job5 then
p[i].leaderstats.Money.Value = p[i].leaderstats.Money.Value + 150
end
end
end
Report Abuse
Shobobo99 is not online. Shobobo99
Joined: 30 Dec 2008
Total Posts: 5754
10 Jul 2011 01:49 PM
I didnt mean to post the script sorry.
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
10 Jul 2011 01:50 PM
job.Job1 is a BrickColorValue

I forgot to define p i think ._.
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
10 Jul 2011 01:50 PM
I was semi-ninja'd by shobobo
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
10 Jul 2011 01:51 PM
@Dragon

Neither your will work cuze you defined p uncorrectly.
But thanks i know how to fix it now.
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
10 Jul 2011 01:52 PM
I defined it incorrectly? How so?
Was it not players that you're trying to loop through?
oh well.
Report Abuse
Shobobo99 is not online. Shobobo99
Joined: 30 Dec 2008
Total Posts: 5754
10 Jul 2011 01:52 PM
if the children of "job" are BrickColorValues then you need to get the Value of them.

while true do wait(60*2)
m = Instance.new("Message", Workspace)
m.Text = "Its Time For Payment... Everyone Who Has A Job Gets 70 Cash, Visitors Get 35 Cash."
wait(4)
m:Remove()
job = game.Workspace.Jobs
local p = game.Players:GetPlayers()
for i = 1, #p do
local TC = p[i].TeamColor
if TC == job.Job1.Value or TC == job.Job2.Value or TC == job.Job3.Value then
p[i].leaderstats.Money.Value = p[i].leaderstats.Money.Value + 70
elseif TC == job.Job4.Value then
p[i].leaderstats.Money.Value = p[i].leaderstats.Money.Value + 35
elseif TC == job.Job5.Value then
p[i].leaderstats.Money.Value = p[i].leaderstats.Money.Value + 150
end
end
end
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
10 Jul 2011 01:53 PM
You wrote like this:

game.Players.GetPlayer()

As i know it is suposed to be like this:

game.Players:GetPlayer() -- its not . but : at GetPlayer()
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
10 Jul 2011 01:54 PM
Ah, sorry, I've been coding in Java all day today, and it uses a . to use methods.
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
10 Jul 2011 01:55 PM
No problem :P

Thanks for help, works fine now.
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