how can i code an execute button for a serversided script executor? I was trying to teach my friends on how to use it so they dont ask me for a game that supports ServerSide scripts, and give them some.~~~~~~~~~~~~~~~~~ --1 thing I forgot to mention: I need the button to be used in a gui that can be used in EVERY game, all inside a MainModule. ~~~~~~~~~~~~~~~~~
I do not understand fully what you mean. I don't know if you mean you want a button that will run a server-side script? I am very confused. If you do and you want to use GUI's, you can use events to send data to another script and then execute the function.
If you want to make a GUI Button that fires a event on the server and do something with that then add a Button and a local script inside it with this code:
local Button = script.Parent local Player = game:GetService("Players").LocalPlayer local ReplicatedStorage = game:GetService("ReplicatedStorage") local Event = ReplicatedStorage:WaitForChild("Event") Button.MouseButton1Click:Connect(function() Event:FireServer(Player) end)
and add a Server script in ServerScriptService with this code:
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Event = ReplicatedStorage:WaitForChild("Event") Event.OnServerEvent:Connect(function(Player) print("Event got fired by : "..Player.Name) -- do what ever u want end)
and also u need to add a RemoteEvent in ReplicatedStorage
--1 thing I forgot to mention: I need the button to be used in a gui that can be used in EVERY game, all inside a MainModule.