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

How would I make a button that activates a script when it is clicked?

Asked by 6 years ago

I don't understand how to make a button run a script but everything I've tried hasn't worked. Sorry for my beginner knowledge but I would like some help. I would like the script and the explanation of what each part does. I would also like some example to go with the script so I know how it works.

1 answer

Log in to vote
1
Answered by
tacotown2 119
6 years ago
Edited 6 years ago
-- put a local script in the gui u want to click
local plr = game:GetService("Players").LocalPlayer -- locating plr
local gui = script.Parent -- locating the gui u want it to click
gui.MouseButton1Click:Connect(function() --makes clicking function
 game.ServerScriptService.Script.Disabled = false -- u have to locate ur script urself srry this is a example
end)
-- i hope u understand ask questions if u have one
0
Thank you fixed it (>_<) uncledanthesantaman 0 — 6y
2
can u accept te answer? lol tacotown2 119 — 6y
Ad

Answer this question