talk2me2
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 1051 |
|
|
| 20 Nov 2013 12:06 PM |
I am not sure what is going wrong exactly, but I know it is the last part, and the first part of the script. The script is meant to give the player 5k points if they have VIP1, 20k if they have VIP2, and 25k if they have both VIPS each time they join. Also, if you have VIP1, you get +5 points a second, VIP2 gives you +20 points a second, and both VIPs give you +25 a second. It also saves/loads.
wait() vippassid1 = 133197742 vippassid2 = 133204602 add = 5000 add2 = 20000 addboth = 25000
game.Players.PlayerAdded:connect(function(plr) plr:WaitForDataReady() local stats = Instance.new("IntValue", plr) stats.Name = "leaderstats" local pts = Instance.new("IntValue", stats) pts.Name = "Points" pts.Value = plr:LoadNumber("Pts") if (game:GetService("BadgeService"):UserHasBadge(plr.userId, vippassid1) and game:GetService("BadgeService"):UserHasBadge(plr.userId, vippassid2)) then pts.Value = pts.Value + addboth elseif game:GetService("BadgeService"):UserHasBadge(plr.userId, vippassid1) then pts.Value = pts.Value + add elseif game:GetService("BadgeService"):UserHasBadge(plr.userId, vippassid2) then pts.Value = pts.Value + add2 end pts.Changed:connect(function() plr:SaveNumber("Pts", pts.Value) end) Spawn(function() while wait(1) do if (game:GetService("BadgeService"):UserHasBadge(ply.userId, vippassid1) and game:GetService("BadgeService"):UserHasBadge(ply.userId, vippassid2)) then pts.Value = pts.Value + 25 elseif game:GetService("BadgeService"):UserHasBadge(ply.userId, vippassid2) then pts.Value = pts.Value + 20 elseif game:GetService("BadgeService"):UserHasBadge(ply.userId, vippassid1) then pts.Value = pts.Value + 5 end if not (game:GetService("BadgeService"):UserHasBadge(ply.userId, vippassid1) or game:GetService("BadgeService"):UserHasBadge(ply.userId, vippassid2)) then pts.Value = pts.Value + 1 end end end) end) |
|
|
| Report Abuse |
|
|
|
| 20 Nov 2013 12:07 PM |
| I do not have the patients to read this so what line errors? |
|
|
| Report Abuse |
|
|
talk2me2
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 1051 |
|
|
| 20 Nov 2013 12:08 PM |
| PlayerAdded doesn't function in play solo, sorry. |
|
|
| Report Abuse |
|
|
|
| 20 Nov 2013 12:10 PM |
| I know, that is why you use Start Server/Player |
|
|
| Report Abuse |
|
|
talk2me2
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 1051 |
|
|
| 20 Nov 2013 12:14 PM |
It doesn't function in that either.
Unless it is me. |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Nov 2013 12:16 PM |
| If there is nil output use prints after every line and tell what line it stops on. |
|
|
| Report Abuse |
|
|
talk2me2
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 1051 |
|
|
| 20 Nov 2013 12:22 PM |
Printed something on every line, nothing showed. Weird.
wait() vippassid1 = 133197742 vippassid2 = 133204602 add = 5000 add2 = 20000 addboth = 25000 print("START") game.Players.PlayerAdded:connect(function(plr) print("1") plr:WaitForDataReady() print("2") local stats = Instance.new("IntValue", plr) print("3") stats.Name = "leaderstats" print("4") local pts = Instance.new("IntValue", stats) print("5") pts.Name = "Points" print("6") pts.Value = plr:LoadNumber("Pts") print("7") if (game:GetService("BadgeService"):UserHasBadge(plr.userId, vippassid1) and game:GetService("BadgeService"):UserHasBadge(plr.userId, vippassid2)) then print("both passes") pts.Value = pts.Value + addboth elseif game:GetService("BadgeService"):UserHasBadge(plr.userId, vippassid1) then print("vip 1") pts.Value = pts.Value + add elseif game:GetService("BadgeService"):UserHasBadge(plr.userId, vippassid2) then print("vip 2") pts.Value = pts.Value + add2 end print("8") pts.Changed:connect(function() print("9") plr:SaveNumber("Pts", pts.Value) end) print("10") Spawn(function() print("11") while wait(1) do print("12") if (game:GetService("BadgeService"):UserHasBadge(ply.userId, vippassid1) and game:GetService("BadgeService"):UserHasBadge(ply.userId, vippassid2)) then print("13") pts.Value = pts.Value + 25 elseif game:GetService("BadgeService"):UserHasBadge(ply.userId, vippassid2) then print("14") pts.Value = pts.Value + 20 elseif game:GetService("BadgeService"):UserHasBadge(ply.userId, vippassid1) then print("15") pts.Value = pts.Value + 5 end if not (game:GetService("BadgeService"):UserHasBadge(ply.userId, vippassid1) or game:GetService("BadgeService"):UserHasBadge(ply.userId, vippassid2)) then print("16") pts.Value = pts.Value + 1 end end end) end) print("Ended") |
|
|
| Report Abuse |
|
|
|
| 20 Nov 2013 12:24 PM |
| ? I don't understand.. Then there is no error in your script. |
|
|
| Report Abuse |
|
|
talk2me2
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 1051 |
|
|
| 20 Nov 2013 12:25 PM |
| Something weird here... The first/last bits do not work... |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 20 Nov 2013 12:52 PM |
Where is the script located?
Make sure it's not disabled. |
|
|
| Report Abuse |
|
|
talk2me2
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 1051 |
|
|
| 20 Nov 2013 01:44 PM |
| Not disabled, and it is located in the Workspace. Straight in there, not in a part. |
|
|
| Report Abuse |
|
|
talk2me2
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 1051 |
|
| |
|
einsteinK
|
  |
| Joined: 22 May 2011 |
| Total Posts: 1015 |
|
| |
|
talk2me2
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 1051 |
|
| |
|
talk2me2
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 1051 |
|
| |
|
talk2me2
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 1051 |
|
| |
|
talk2me2
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 1051 |
|
| |
|
M39a9am3R
|
  |
| Joined: 10 Nov 2012 |
| Total Posts: 1933 |
|
|
| 21 Nov 2013 06:11 AM |
| I don't think he defined the parent of the leaderstats values. If the error is they are not showing up then that's why. So you would want the leaderstats value to have the parent of the new player, and the points to be the child of leaderstats. |
|
|
| Report Abuse |
|
|
talk2me2
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 1051 |
|
|
| 21 Nov 2013 10:59 AM |
I did. You can parent objects by using a second argument.
local stats = Instance.new("IntValue", plr) --Look. stats.Name = "leaderstats" local pts = Instance.new("IntValue", stats) pts.Name = "Points" |
|
|
| Report Abuse |
|
|