So, I have this script located in StarterGui, that whenever you press F it will create a light that acts like a flashlight, inside the RootPart of the player. When you press F again it will dissapear. However, you can only see it on your client. How can I make it serverside?
local inputService = game:GetService("UserInputService") local tweenService = game:GetService("TweenService") local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0) local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local enabled = false local light inputService.InputBegan:Connect(function(Input) if Input.KeyCode == Enum.KeyCode.F then if not enabled then light = Instance.new("PointLight", character.HumanoidRootPart) light.Brightness = 2 light.Name = "TorsoLight" light.Range = 0 light.Shadows = true tweenService:Create(light, tweenInfo, {Range = 25}):Play() game.Workspace.SoundEffects.FlashlightOn:Play() enabled = true else tweenService:Create(light, tweenInfo, {Range = 0}):Play() game.Workspace.SoundEffects.FlashlightOff:Play() wait(0.70) light:Destroy() enabled = false end end end)
You can use RemoteEvents