|
| 29 Sep 2015 07:38 PM |
function onTouch(hit) game.Players.LocalPlayer.leaderstats.Candy.Value = "+1" end script.Parent.Touched:connect(onTouch) I'm trying to make a script that will add 1 candy when you touch it It isn't working look over my script |
|
|
| Report Abuse |
|
|
SlickV
|
  |
| Joined: 23 Apr 2015 |
| Total Posts: 78 |
|
|
| 29 Sep 2015 07:42 PM |
Leaderstats isn't my strong point but try this,
function onTouch(hit) game.Players.LocalPlayer.leaderstats.Candy.Value = ""+1 end script.Parent.Touched:connect(onTouch)
Don't quote me on this. |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 29 Sep 2015 07:44 PM |
first off that kid who replied was so wrong that i cant even believe it
script.Parent.Touched:connect(function(hit) local play = game.Players:GetPlayerFromCharacter(hit.Parent) if play then play.leaderstats.Candy.Value = play.leaderstats.Candy.Value + 1 end end)
➳Lɪᴛᴀʟᴇʟᴀ ɪs ᴍʏ ɴᴀᴍᴇ, Lᴜᴀ ɪs ᴍʏ ɢᴀᴍᴇツ |
|
|
| Report Abuse |
|
|
SlickV
|
  |
| Joined: 23 Apr 2015 |
| Total Posts: 78 |
|
|
| 29 Sep 2015 07:47 PM |
In which age do you stop being a child?
As I stated previously, Leaderstats is not my strong point.
Hence, "Don't quote me on this".
|
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 29 Sep 2015 07:48 PM |
leaderstats arent your strong point?
this isnt about leaderstats
thats just a model with values inside
if you dont understand changing a value then you should be the one asking questions not answering them falsely
➳Lɪᴛᴀʟᴇʟᴀ ɪs ᴍʏ ɴᴀᴍᴇ, Lᴜᴀ ɪs ᴍʏ ɢᴀᴍᴇツ |
|
|
| Report Abuse |
|
|
frriend
|
  |
| Joined: 07 Feb 2010 |
| Total Posts: 577 |
|
|
| 29 Sep 2015 07:48 PM |
Well, that is basic lua.. lol. Leaderstats has nothing to do with the problem. You need to write out the variable a second time, like so
var = var + 1
you cannot do var = ""+1
Sorry. :) |
|
|
| Report Abuse |
|
|
SlickV
|
  |
| Joined: 23 Apr 2015 |
| Total Posts: 78 |
|
|
| 29 Sep 2015 07:51 PM |
| I'm more a C++ person myself, in all honesty LUA is not really a strong point, but I know parts of it, enough to make simple weapons, cframes, etc. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
SlickV
|
  |
| Joined: 23 Apr 2015 |
| Total Posts: 78 |
|
|
| 29 Sep 2015 07:58 PM |
| Ok, please before you go accusing me of not being "a C++ type of guy", provide proof. |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2015 07:58 PM |
| Just because you use C++ does not make you a C++ guy |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2015 07:59 PM |
| CFrames isn't really much in Lua, it's more a geometry thing by my understanding. |
|
|
| Report Abuse |
|
|
SlickV
|
  |
| Joined: 23 Apr 2015 |
| Total Posts: 78 |
|
|
| 29 Sep 2015 07:59 PM |
| C++ type of guy, what I mean in that sentence is a prefer to use C++. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 29 Sep 2015 08:00 PM |
| I don't need to provide proof but if I really wanted to, I can invite you to a party and ask you simple questions that shouldn't take more than 10 seconds to answer and of course screenshot your "period of non-response because google" |
|
|
| Report Abuse |
|
|
SlickV
|
  |
| Joined: 23 Apr 2015 |
| Total Posts: 78 |
|
|
| 29 Sep 2015 08:01 PM |
Ask me one right here, I won't use google. And don't just go googling, "c++ quiz!1!11!!!!" |
|
|
| Report Abuse |
|
|
frriend
|
  |
| Joined: 07 Feb 2010 |
| Total Posts: 577 |
|
|
| 29 Sep 2015 08:02 PM |
| Can i join, and watch this go down? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 29 Sep 2015 08:03 PM |
| I won't ask you right here because you have more time to "google" and can blame "flood check" |
|
|
| Report Abuse |
|
|
SlickV
|
  |
| Joined: 23 Apr 2015 |
| Total Posts: 78 |
|
|
| 29 Sep 2015 08:03 PM |
I meant on the forum.
._.
Anyway, I'm nearly full. |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 29 Sep 2015 08:06 PM |
invite me to this party too, this guy is obviously one of those many morons who claims to know C++ for no reason
he can't even add a variable, he isn't a C++ guy, he isn't an anything-guy. |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2015 08:33 PM |
| Dayum, My question turned into a fight. |
|
|
| Report Abuse |
|
|