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

Gui Button click not working - Button Mouse click seems not to be detected. Can somebody help?

Asked by 5 years ago
Edited 5 years ago

So I made a code that should print "hi" but it doesn't work. I think I done it well. Why doesn't work? Pls help.

Here The code screenshot

0
I can't reach the screenshot. PixelRankYT 20 — 5y
0
Edited Stephirio 7 — 5y
0
Put the script in the button and then change the [script.Parent.Buy] to [script.Parent] then it should work. Or there is another item named "Buy" PixelRankYT 20 — 5y
0
Ok thanks Stephirio 7 — 5y
0
Please Accept My Answer As It Worked. EnzoTDZ_YT 275 — 4y

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

not sure if you still need help but they seems to be a mini change for it you get

script.Parent.MouseButton1Click:Connect(function()

    end

you don't want that you want to use that you want to use

script.Parent.MouseButton1Click:Connect(function()

end)

then you put the code in Line 2

Ad
Log in to vote
0
Answered by 5 years ago

Just do

script.Parent.Buy.MouseButton1Click:Connect(function()
print("hi")

Answer this question