I'm making a simple flashlight right now and I was wondering how I could make it appear server-side instead of just client. The code is located in a Local Script in the StarterGui.
local mouse = game.Players.LocalPlayer:GetMouse() function Toggle() local player = game.Players.LocalPlayer Local char = player.Character local active = char.Head:FindFirstChild("Light") if active then active:Destroy() script.Parent.Light.Frame.Icon.Image = "rbxassetid://" else local light = Instance.new("PointLight",char:FindFirstChild("Head")) ---- blah light setting end end mouse.KeyDown:connect(function(key) key = key:lower() if key == "f" then Toggle() end end)
if there is any issues w/ this code then its probably because I typed it instead of copy and pasting it.
Remote events would be useful
https://developer.roblox.com/articles/Remote-Functions-and-Events
^^^ Thats how Remotes work