|
| 06 Nov 2014 02:26 PM |
I'm trying to make a SurfaceGUI that counts the amount of times you shoot a ball. However I don't know how to make the count add to the TextLabel.
local p = script.Parent +1 local c = script.Parent.Parent
for i,v in pairs(c) do if p then c = c + 1 end end
Value is in the TextLabel.
Can anyone help me with this? What am I doing wrong? |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Nov 2014 02:34 PM |
'What am I doing wrong? '
'script.Parent+1'--script.Parent is a object, did you mean script.Parent.Value?
c =c+1--doesn't change the object, and are you trying to check if its == p?
while wait() do local p = script.Parent.Value+1 local c = script.Parent.Parent:children() for I,v in pairs(c) do if v.Value == p then v.Value = v.Value+1 end end end
--if not, ya lost me |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2014 02:37 PM |
Oh I see what's wrong now, thanks.
But now that you told me that, it cancelled out my script that when it touches the ball, it adds it.
local p = script.Parent.Value for i,v in pairs(game.Workspace.Globe) do if function (onTouch) p = p + 1 end
Did I do something wrong here? |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2014 02:42 PM |
| If anyone helps me with that one, that'd be swell xD |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2014 02:48 PM |
| If someone is willing to help me with this, I'd gladly put credit to you. |
|
|
| Report Abuse |
|
|