Advertisement
4zx16

Basic Serverside Execution (Client) + RemoteEvent Needed

Jun 22nd, 2022 (edited)
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.35 KB | Software | 0 0
  1. --[[
  2.  || 📜 AUTHOR: @4zx16 || BASIC SERVERSIDE EXECUTION (CLIENT)
  3. ]]
  4. local Shortcuts = {
  5.     Remote_Event = script.Parent.Execute;
  6.     Button = script.Parent;
  7.     User = game:GetService("Players").LocalPlayer;
  8. }
  9. local Settings = {
  10.     Allow_Execution = true;
  11.     Allow_Studio = true;
  12.     RunService = game:GetService("RunService");
  13. }
  14. --[[
  15. ---------------------------------------------------------------------
  16.                YOU'RE RUNNING THE BASIC EXECUTION VERSION:
  17. ----------------------------------------------------------------------
  18. --]]
  19. local function BasicExecution()
  20.     if Settings.RunService:IsStudio() and Settings.Allow_Studio == false and Settings.Allow_Execution == true then
  21.         Shortcuts.User:Destroy()
  22.     elseif Settings.Allow_Studio == false and Settings.Allow_Execution == false then
  23.         Shortcuts.User:Destroy()
  24.     elseif Settings.Allow_Studio == true and Settings.Allow_Execution == false then
  25.         return error("Execution is off!")
  26.     elseif Settings.Allow_Studio == true and Settings.Allow_Execution == true then
  27.         Shortcuts.Remote_Event:FireServer()
  28.     elseif Settings.RunService:IsClient() and Settings.Allow_Execution == false then
  29.         return error("Execution is off!")
  30.     elseif Settings.RunService:IsClient() and Settings.Allow_Execution == true then
  31.         Shortcuts.Remote_Event:FireServer()
  32.     end
  33. end
  34. Shortcuts.Button.MouseButton1Down:Connect(BasicExecution)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement