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
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Minigames Issue

Previous Thread :: Next Thread 
scripteer is not online. 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
leolion113 is not online. leolion113
Joined: 11 Oct 2008
Total Posts: 3336
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 is not online. 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
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