Alright, so here's what I'm trying to do.
Whenever someone would click this certain brick, their 'score' in a GUI I made would go up by 1 each time they click the brick. For some reason, I cannot get this to work.
Also, there's two TextLabels where the score is supposed to show. One is just plain white, the other is just a shadow to make it fancy.
Also, I'd like for the score to first be changed in a NumberValue and then the two TextLabels be equal to whatever the NumberValue is set to. This way, I can use the Data Store later for automatic score saving.
Anyways, here's some screenshots:
ClicksGui Hierarchy: http://prntscr.com/2x6ihd ClicksGui to player script: http://prntscr.com/2x6imt ClicksGui Script: http://prntscr.com/2x6ivl The actual GUI: http://prntscr.com/2x6kvu And last but not least, the brick that changes your score each time you click it: http://prntscr.com/2x6j7i
Hopefully my question (second 'paragraph' from top - it's not structured like a sentence but you know what I mean) is clear and understandable. Thank you in advanced!
On this screenshot, not really sure which it is, there doesn't seem to be an actually script in there. That would be the problem.
Unless your question is, how you would go about it. In that case we would use the following;
--[[ First, we need to change 'score.' From my experience, having ".Value" in a variable just doesn't seem to work. That may or may not be the case, but just for safety, I would recommend removing the .Value from the variable. **Same thing with the ".Text". ]]-- local text1 = --Put the "ClicksNumLabelText line here, without the .Text local text2 = --Same thing, but with the Shadow one local score = script.ClicksNum function onMouseClick(click) score.Value = score.Value + 1 text1.Text = tostring(score.Value) text2.Text = tostring(score.Value) end -- And here is where you would have the connect
NOTE: The above script has not, in any way, been tested. It is rough code, and with that, you are bound to find bugs.
Change your connect line (14) to:
button.ClickDetector.MouseClick:connect(onMouseClicked)