Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[UNANSWERED] MouseButton1Down not working?

Asked by 8 years ago

FilteringEnabled is disabled, Yet this script does not work? It prints waiting and waited but nothing when the textbutton is clicked?

print("waiting") -- prints
wait(5)
print("waited") -- prints

local CurrentWager = script.Parent.CurrentWager
local MinBet = script.Parent.MinBet
local Text = a.Wager.SurfaceGui.TextLabel

Text.Text = "Bet: ".. MinBet.Value -- successfully changes the text
--when the textbutton mentioned below is clicked, nothing happens, no output, notta
script.Parent.Increase.SurfaceGui.TextButton.MouseButton1Down:connect(function ()
        print("function activated")
        print("start value".. CurrentWager.Value)
        CurrentWager.Value = CurrentWager.Value + 1
        print("end value".. CurrentWager.Value)
end)

1 answer

Log in to vote
0
Answered by 8 years ago

Well, you forgot to repeat the code after end), you always have to repeat the code in order for it to work, example.

script.Parent.Increase.SurfaceGui.TextButton.MouseButton1Down:connect(onClicked)
0
The (onClicked) part is probably wrong XD GreekGodOfMLG 244 — 8y
0
Try (mouse) or (onButton1Down), and maybe add this on the last line of the script: script.Parent.Increase.SurfaceGui.TextButton:connect(onButton1Down) RobotChitti 167 — 8y
0
No you don't, see Anonymous Functions -- http://wiki.roblox.com/index.php?title=Anonymous_function magiccube3 115 — 8y
Ad

Answer this question