|
| 23 Dec 2016 02:57 PM |
When I click the button, it's only changing to the "VISUAL: 2" not the other numbers?
function onClicked() script.Parent.Parent.TextButton.Text = "VISUAL: 2" end
script.Parent.MouseButton1Click:connect(onClicked)
function onClicked() script.Parent.Parent.TextButton.Text = "VISUAL: 3" end
script.Parent.MouseButton1Click:connect(onClicked)
function onClicked() script.Parent.Parent.TextButton.Text = "VISUAL: 4" end
script.Parent.MouseButton1Click:connect(onClicked)
function onClicked() script.Parent.Parent.TextButton.Text = "VISUAL: 5" end
script.Parent.MouseButton1Click:connect(onClicked)
function onClicked() script.Parent.Parent.TextButton.Text = "VISUAL: 6" end
script.Parent.MouseButton1Click:connect(onClicked)
function onClicked() script.Parent.Parent.TextButton.Text = "VISUAL: 7" end
script.Parent.MouseButton1Click:connect(onClicked)
|
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 23 Dec 2016 02:59 PM |
I died.
script.Parent.MouseButton1Click:connect(function() script.Parent.Parent.TextButton.Text = "VISUAL: " ..tonumber(string.sub(8)) + 1 end)
~ lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao lmfao ~ |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 03:00 PM |
Thanks, my apologies, I'm horrible at scripting.
|
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 03:02 PM |
Now, it's not working at all.
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 23 Dec 2016 03:50 PM |
what is this supposed to do??
Siggynature |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 03:59 PM |
theres a substitute way which might take longer,
have 8 buttons each called visual1,visual2,etc
make all them invisible except visual 1 and make a script whenever u click visual 1 it makes it invis and shows visual 2 and so on and so forth
Siggynature |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 04:08 PM |
that takes too long, it'd be easier if it were one button +1 each time someone clicks it
|
|
|
| Report Abuse |
|
|
Revorious
|
  |
| Joined: 04 Feb 2012 |
| Total Posts: 477 |
|
|
| 23 Dec 2016 04:18 PM |
local Vis = 1 local MaxVis = 8
function onClicked() script.Parent.Parent.TextButton.Text = "VISUAL: "..Vis if Vis == MaxVis then Vis = 1 else Vis = Vis +1 end end
script.Parent.MouseButton1Click:connect(onClicked)
local Globe = workspace; repeat wait(1) print('Hello World!') until Globe == nil |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 04:20 PM |
Script also doesn't work ^
|
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 04:20 PM |
My bad, yes, it does.
Thanks, mate.
|
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 04:22 PM |
How would I make it minus when I right click?
Left click adds the number up, how would I make it so when you right click the number goes down?
Isn't that function broken?
MouseButton2Down?
|
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 04:23 PM |
This is what I have now, but when I do right click, it leaves me off at another random number.
local Vis = 1 local MaxVis = 30
function onClicked() script.Parent.Parent.Visual1.Text = "VISUAL: "..Vis if Vis == MaxVis then Vis = 1 else Vis = Vis +1 end end
script.Parent.MouseButton1Click:connect(onClicked)
local Vis = 1 local MaxVis = 30
function onClicked() script.Parent.Parent.Visual1.Text = "VISUAL: "..Vis if Vis == MaxVis then Vis = 1 else Vis = Vis -1 end end
script.Parent.MouseButton2Down:connect(onClicked)
|
|
|
| Report Abuse |
|
|
icelys
|
  |
| Joined: 13 Mar 2016 |
| Total Posts: 49 |
|
|
| 23 Dec 2016 04:38 PM |
| You keep on naming your functions "onClicked". However, you already declared this function earlier. Try giving each function that you connect a different name, as they both have different bodies. |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 05:34 PM |
Thanks, that did the trick
|
|
|
| Report Abuse |
|
|
|
| 23 Dec 2016 05:36 PM |
How would I make the MaxVis = 0 when I minus? It just keeps going down infinite. I want it to stop at 0 (when right click, it minuses 1)
local Vis = 1 local MaxVis = 30
function whenclicked() script.Parent.Parent.Visual1.Text = "VISUAL: "..Vis if Vis == MaxVis then Vis = 1 else Vis = Vis -1 end end
script.Parent.MouseButton2Down:connect(whenclicked
|
|
|
| Report Abuse |
|
|