|
| 13 Jun 2013 08:20 AM |
I was making a level and experience script, but whether I multiply the experience by 1.5 or not, the number stays the same. Here's my changed function for the KOsRound, which is the number of points you will get at the end of the round. I want you to get 1.5 times the amount of points.
va = v.Value v.Changed:connect(function(val) if val == 0 then va = val return end ex.Value = ex.Value + math.floor((val-va)*1.5) va = val end)
This is not the whole script. The whole one is kinda long. |
|
|
| Report Abuse |
|
|
neongoo51
|
  |
| Joined: 12 May 2009 |
| Total Posts: 33061 |
|
|
| 13 Jun 2013 08:23 AM |
If you're using an integer, the game will probably not accept the arthmetic operation since it probably returns a number with decimals in it.
Try multiplying a number, then transferring the result to an IntValue.
{ERROR: Signature.exe not found} |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2013 08:24 AM |
| Nevermind, I fixed it. I changed all the val to v.Value. |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2013 08:51 AM |
More problems! Here's my changed function after the first one. Once the experience is at 10, it won't change the level until it gets higher than 10. Also, it is just setting the experience to 0.
ex.Changed:connect(function(val) if ex.Value >= l.Value * 10 then ex.Value = ex.Value - (l.Value*10) l.Value = l.Value + 1 end end) |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2013 09:18 AM |
| It works fine in play solo mode, but not in regular play mode. D: |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Jun 2013 09:50 AM |
| How is your .PlayerAdded event set up? |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2013 09:54 AM |
| There is that event with the argument p. First it creates the values, then the events. |
|
|
| Report Abuse |
|
|
databrain
|
  |
| Joined: 01 Jan 2013 |
| Total Posts: 3342 |
|
|
| 13 Jun 2013 10:01 AM |
when you do something.changed:connect(function(val) I think val is the property, not the value. Not too sure, but I'm pretty sure
Emerson wrote an essay on that |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2013 10:02 AM |
| I'm not using val. I'm using ex.Value. |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2013 10:05 AM |
You need to hook up the .Changed event on the actual object, not the value property.
StringValue.Value.Changed:connect(function() end) --> Doesn't work
StringValue.Changed:connect(function() end) --> Does work |
|
|
| Report Abuse |
|
|
| |
|
| |
|
databrain
|
  |
| Joined: 01 Jan 2013 |
| Total Posts: 3342 |
|
|
| 13 Jun 2013 10:12 AM |
function ChangeLevel() if ex.Value >= l.Value * 10 then ex.Value = ex.Value - l.Value * 10 l.Value = l.Value + 1 if ex.Value >= l.Value * 10 then ChangeLevel() end end end ex.Changed:connect(ChangeLevel)
That way if they earn 2 levels in one change, it will repeat the function.
I don't see anything wrong with this script, post the entire script.
Emerson wrote an essay on that |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2013 10:14 AM |
| It says there is a word too harsh in it. Idk why. |
|
|
| Report Abuse |
|
|
databrain
|
  |
| Joined: 01 Jan 2013 |
| Total Posts: 3342 |
|
|
| 13 Jun 2013 10:16 AM |
Also, you are gonna get your account disabled shortly after you posted that script then. It's a stupid roblox bug
Emerson wrote an essay on that |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Jun 2013 10:17 AM |
| Oh. That's not good. Also some of the words that are in that script are: K!lls, Di3d, K0s |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2013 10:24 AM |
Kills, Died, KOs?
Must be something else. |
|
|
| Report Abuse |
|
|
databrain
|
  |
| Joined: 01 Jan 2013 |
| Total Posts: 3342 |
|
|
| 13 Jun 2013 10:29 AM |
Look for words like P@@$word, or su1cid3
Emerson wrote an essay on that |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2013 10:36 AM |
| What about sw0rds or pist0ls? Also, data, your script worked. :D |
|
|
| Report Abuse |
|
|