CBD55
|
  |
| Joined: 26 Apr 2011 |
| Total Posts: 347 |
|
|
| 01 Feb 2013 06:31 PM |
script.Parent.Touched:connect(function(touch) local player = Game.Players:GetPlayerFromCharacter(touch.Parent) if player and player:findFirstChild("leaderstats") then local stats = player.leaderstats.Points if stats.5.Value < 1 then stats.5.Value = leaderstats.Points.Value + 1 end end end)
|
|
|
| Report Abuse |
|
|
|
| 01 Feb 2013 06:35 PM |
if stats.5.Value < 1 then stats.5.Value = leaderstats.Points.Value + 1 -- leaderstats is undefined
I'm not sure if "5" is the value of the stats, or what. But here's my guess:
if stats.5.Value < 1 then stats.5.Value = stats.Value + 1
ιησя∂ιηαтυѕ |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
| |
|
CBD55
|
  |
| Joined: 26 Apr 2011 |
| Total Posts: 347 |
|
|
| 01 Feb 2013 07:19 PM |
| I have a leader board script too, do you want to see that? |
|
|
| Report Abuse |
|
|
|
| 01 Feb 2013 07:25 PM |
Make sure it is ("leaderstats"), and not ("Leaderstats"). CAPS matter :P
+-Fishy |
|
|
| Report Abuse |
|
|
CBD55
|
  |
| Joined: 26 Apr 2011 |
| Total Posts: 347 |
|
| |
|
|
| 01 Feb 2013 08:40 PM |
| i did they before someone of theam dont work :( |
|
|
| Report Abuse |
|
|
CBD55
|
  |
| Joined: 26 Apr 2011 |
| Total Posts: 347 |
|
|
| 02 Feb 2013 06:50 AM |
This is my leader board script:
function CreateStats(NewPlayer) local MainStats = Instance.new("IntValue") MainStats.Name = "leaderstats" MainStats.Value = 0 local PointsValue = Instance.new("IntValue") PointsValue.Name = "Points" PointsValue.Value = 0 PointsValue.Parent = MainStats MainStats.Parent = NewPlayer return MainStats end game.Players.ChildAdded:connect(CreateStats)
And this is my point brick script:
script.Parent.Touched:connect(function(touch) local player = Game.Players:GetPlayerFromCharacter(touch.Parent) if player and player:findFirstChild("leaderstats") then local stats = player.leaderstats.Points if stats.Value < 1 then stats.Value = stats.Value + 1 stats.Value = leaderstats.Points.Value + 1 end end end)
Do you think there is any roblems with them connecting? |
|
|
| Report Abuse |
|
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
| |
|