Im trying to make a gun flash however other players cant see it. How would I make this script work serverside so that other players can see it?
local Flash = script.Parent
local UserInputService = game:GetService("UserInputService")
local Tool = script.Parent
local Player = game.Players.LocalPlayer
UserInputService.InputBegan:Connect(function(InputObject)
if InputObject.UserInputType == Enum.UserInputType.MouseButton1 then
Flash.Enabled = true
if Flash.Enabled == true
then
wait(0.01)
Flash.Enabled = false
end
end
end)

2 comments
Use Remote Events or Functions: https://wiki.roblox.com/index.php?title=Remote_Functions_%26_Events
remote events, server scripts cant use the UserInputService