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 | -- put a local script in the gui u want to click |
2 | local plr = game:GetService( "Players" ).LocalPlayer -- locating plr |
3 | local gui = script.Parent -- locating the gui u want it to click |
4 | gui.MouseButton 1 Click:Connect( function () --makes clicking function |
5 | game.ServerScriptService.Script.Disabled = false -- u have to locate ur script urself srry this is a example |
6 | end ) |
7 | -- i hope u understand ask questions if u have one |