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

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

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

-- 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

2 comments

0

Thank you fixed it (>_<)

2

can u accept te answer? lol

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