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

surface gui button not clicking on first try ?

i seriously have to work to click that button !

script.Parent.MouseButton1Up:connect(function()
	script.Parent.Parent.Parent.Parent.Part1.SurfaceGui.TextBox.Text = script.Parent.Text
	script.Parent.Parent.Parent.BrickColor = BrickColor.new("Bright green")
	if script.Parent.Text == "Good" then
		script.Parent.Parent.Parent.Parent.Number.Value = script.Parent.Parent.Parent.Parent.Number.Value + 1
	elseif script.Parent.Text == "Bad" then
		script.Parent.Parent.Parent.Parent.Number.Value = script.Parent.Parent.Parent.Parent.Number.Value - 1
	end
end)

11 comments

0

Is this a ClickDetector?

0

its a textbutton inside a surface gui

0

Is there anything in the output?

0

nope just its very hard to click but it does click

0

So it works fine?

0

em not really its not suppose be hard to click

0

Maybe it's your mouse.

0

no lol guis work fine but surface gui doesnt want to click

0

Are you sure it's not MouseButton1Down?

0

ill try it

1

MouseButton1Up will only execute when you release a left click, try MouseButton1Down or MouseButton1Click

1 answer

✓ Accepted answer

I'm not sure but if you change the event it might solve your problem. However I'm not 100% sure it will help you out with the "Clicking" difficulties.

script.Parent.MouseButton1Click:connect(function()-- I change it to MouseButton1Click which might help.
    script.Parent.Parent.Parent.Parent.Part1.SurfaceGui.TextBox.Text = script.Parent.Text
    script.Parent.Parent.Parent.BrickColor = BrickColor.new("Bright green")
    if script.Parent.Text == "Good" then
        script.Parent.Parent.Parent.Parent.Number.Value = script.Parent.Parent.Parent.Parent.Number.Value + 1
    elseif script.Parent.Text == "Bad" then
        script.Parent.Parent.Parent.Parent.Number.Value = script.Parent.Parent.Parent.Parent.Number.Value - 1
    end
end)

1 comment

0

basically what i just said in a comment :/

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