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

Button1Down() Event Help?

Asked by
iLegitus 130
10 years ago

Alright so ive tried :


--[Functions]-- function RodClick() script.Parent.Parent.GripUp.X = CFrame.new(0,1,1.5) wait(1) script.Parent.Parent.GripUp.X = CFrame.new(0,1,0) end --[ script.Parent.MouseButton1Down:connect(Button1Down+RodClick)

I simply want to,Once the Left mouse button is clicked,I want it to run the RodClick() Function,Anybody help?

1 answer

Log in to vote
1
Answered by 10 years ago

You only need to put the name of the function in the parentheses.

-- Functions
function RodClick()
    script.Parent.Parent.GripUp.X = CFrame.new(0,1,1.5)
    wait(1)
    script.Parent.Parent.GripUp.X = CFrame.new(0,1,0)

end

script.Parent.MouseButton1Down:connect(RodClick) -- Button1Down isn't needed here.
0
Thank you,MasterDaniel. iLegitus 130 — 10y
0
No problem. I'd advise against the use of -- too unless you are commenting, as your use of "--[Functions]-- has commented out the function RodClick()" I've corrected this on my answer. MasterDaniel 320 — 10y
Ad

Answer this question