So, i have this script that toggles a trail in my game. There's a version of the script for two different trails, and a toggle all, in case that changes anything. I want to make it a server script, so everyone can see when someone toggles their trail.
local gui = script.Parent local button = gui.ImageButton local frame = gui.Frame local function onClick() -- Create the function if frame.Visible == true then -- If the frame is seen, disable the visibility, otherwise enable it. frame.Visible = false else frame.Visible = true end end button.MouseButton1Click:connect(onClick) -- onClick is the function name. MouseButton1Click is the event.
It should be fine to change it to a server script also you can change the onClick Function to this
local function onClick() -- Create the function frame.Visible = not frame.Visible end