✓ Accepted answer
Remote Events. Remote Events allow the server and the client to communicate with each other. Make sure you put the Remote Event in ReplicatedStorage.
Local Script
local Player = script.Parent.Parent
local Mouse = Player:GetMouse()
local remoteEvent = game.ReplicatedStorage.RemoteEvent
Mouse.Button1Down:Connect(function()
remoteEvent:FireServer()
end)
Server Script
local remoteEvent = game.ReplicatedStorage.RemoteEvent
remoteEvent.OnServerEvent:Connect(function(player)
player.Character.Torso.Fire:Play()
end)
2 comments
What are you trying to accomplish?
I am trying to make a gunshot sound, but i dont know how to do it server sided.