scripteer
|
  |
| Joined: 11 Mar 2011 |
| Total Posts: 67 |
|
|
| 14 Apr 2012 10:43 AM |
I have a script so that when you touch a block it will give you a point but it says there is an error and it cant perform arithmatic on a characters Userdata, is there anyway to make it still give points?
Error message: Workspace.Part.Script:5: attempt to perform arithmatic on field 'Points' (a userdata value)
Disconnected event because of exception
and here is my script, what am I supposed to change so that it can get around this issue?
function Points(Recieve) if Recieve.Parent.Humanoid ~= nil then Name = Recieve.Parent.Name GiveTo = game.Players:findFirstChild(Name) GiveTo.leaderstats.Points = GiveTo.leaderstats.Points + 1 end end
script.Parent.Touched:connect(Points) |
|
|
| Report Abuse |
|
|
|
| 14 Apr 2012 10:45 AM |
function Points(Recieve) if Recieve.Parent.Humanoid ~= nil then Name = Recieve.Parent.Name GiveTo = game.Players:findFirstChild(Name) GiveTo.leaderstats.Points.Value = GiveTo.leaderstats.Points.Value + 1 -- You was trying to add +1 to basically nothing :3 end end script.Parent.Touched:connect(Points) |
|
|
| Report Abuse |
|
|
scripteer
|
  |
| Joined: 11 Mar 2011 |
| Total Posts: 67 |
|
|
| 14 Apr 2012 10:47 AM |
oh wow... I cant believe I missed that, thanks so much!
|
|
|
| Report Abuse |
|
|