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.
COMMUNITY QUESTION
How would I make a button that activates a script when it is clicked?
1 answer
-- 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
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Thank you fixed it (>_<)
can u accept te answer? lol