how to execute scripts when a button gui is pressed roblox how to execute scripts when a button gui is pressed roblox how to execute scripts when a button gui is pressed roblox how to execute scripts when a button gui is pressed roblox

The solution for “how to execute scripts when a button gui is pressed roblox how to execute scripts when a button gui is pressed roblox how to execute scripts when a button gui is pressed roblox how to execute scripts when a button gui is pressed roblox” can be found here. The following code will assist you in solving the problem.

function leftClick()
print(“Left mouse click”)
end

function rightClick()
print(“Right mouse click”)
end

script.Parent.MouseButton1Click:Connect(leftClick)
script.Parent.MouseButton2Click:Connect(rightClick)– Doesnt explain WHERE to put what..-
local buttongui = script.Parent — (this is only if your script is inside the gui, and really, should be a local script and not a normal one)
local clicked1 = buttongui.MouseButton1Click
local clicked2 = buttongui.MouseButton2Click — These two variables are useful if you wanna do something more than twice..

function lClick()
buttongui.Text = “left click”
end

function Rclick()
buttongui.Text = “right click”
end

clicked1:Connect(lClick)
clicked2:Connect(RClick)2022-02-03 00:00:07 18334/18334 D/PretiumManager: [doLoadLocalStatusSync] from = X8Application_onCreate_loadLocalStatusSync, file = /data/user/0/com.x8zs.sandbox/files/pretium, file not exist, use none

THEBUTTON.MouseButton1Down:connect(function()
— the function
end)
— this is easy why do many people do it so complicated

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in