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

Button1Down() Event Help?

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

✓ Accepted answer

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.

2 comments

0

Thank you,MasterDaniel.

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.

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