|
| 13 Sep 2015 02:00 PM |
script.Parent.Touched:connect(function(P) if P:FindFirstChild("leaderstats") then print("leaderstats") if P.leaderstats:FindFirstChild("Stage") then print("Stage") if P.leaderstats.Stage.Value > 1 then P.leaderstats.Stage.Value = P.leaderstats.Stage.Value + 1 end end end end) |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 02:02 PM |
| It didn't find the leaderstats nor the stage. |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 02:03 PM |
| Is there an item called "leaderstats" in all the body parts of the character? |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 02:03 PM |
| No, but it's in the player under the "Players" tab. |
|
|
| Report Abuse |
|
|
KLGA
|
  |
| Joined: 19 Apr 2014 |
| Total Posts: 2571 |
|
|
| 13 Sep 2015 02:04 PM |
The parameter of Touched is the part that touches the object. Assuming you don't have 'leaderstats' stored in the legs or whatever part touches this, you'll have to link it to where leaderstats is stored. I'm assuming it's in the player, so you would do something like this:
script.Parent.Touched:connect(function(P) if P.Parent:FindFirstChild("Humanoid") then if game.Players:GetPlayerFromCharacter(P.Parent) then local pl = game.Players:GetPlayerFromCharacter(P.Parent) if pl.leaderstats:FindFirstChild("Stage") then if pl.leaderstats.Stage.Value > 1 then pl.leaderstats.Stage.Value = pl.leaderstats.Stage.Value + 1 end end end end end) |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 02:07 PM |
| @Kl That didn't work.. It's not stored in the player in workspace, it's stored in the player under the "Players" tab. |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 02:10 PM |
script.Parent.Touched:connect(function(P) if P.Parent:FindFirstChild("leaderstats") then print("leaderstats") if P.Parent.leaderstats:FindFirstChild("Stage") then print("Stage") if P.Parent.leaderstats.Stage.Value > 1 then P.Parent.leaderstats.Stage.Value = P.Parent.leaderstats.Stage.Value + 1 end end end end)
|
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Sep 2015 02:12 PM |
| No problem my friend. Need more help? Contact me via PM |
|
|
| Report Abuse |
|
|
| |
|