Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[UNANSWERED] MouseButton1Down not working?

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

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)

3 comments

0

The (onClicked) part is probably wrong XD

0

Try (mouse) or (onButton1Down), and maybe add this on the last line of the script: script.Parent.Increase.SurfaceGui.TextButton:connect(onButton1Down)

0

No you don't, see Anonymous Functions -- http://wiki.roblox.com/index.php?title=Anonymous_function

This discussion is preserved as it was. New answers, comments, and votes are closed.