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

Why is MouseButton1Down malfunctioning?

Asked by 6 years ago

I have a localscript that is in a TextButton. When i click anywhere , the effect is the same to clicking the button. Why does this happen? How can i fix it?script:

01local ready = false
02function onMouseButton1Down()
03    ready = true
04end
05local sp = script.Parent
06sp.MouseButton1Down:Connect(onMouseButton1Down())
07repeat wait(0.1) until ready == true
08if ready == true then
09    local click = false
10    local clone = game:GetService("ReplicatedStorage").Plane:Clone()
11    local mouse = game.Players.LocalPlayer:GetMouse()
12    local firstclick = false
13    clone.Parent = workspace
14    function invisible(model,scale)
15        local c = model:GetChildren()
View all 69 lines...

1 answer

Log in to vote
0
Answered by 6 years ago

On line 6 you're not supposed to have the parenthesis included for the argument of Connect().

Remove the parenthesis () after onMouseButton1Down in line 6.

Ad

Answer this question