I'm trying to change this local script to a server script. Can someone please help? This is the script:
local Player = script.Parent.Parent local Mouse = Player:GetMouse() Mouse.Button1Down:connect(function() Player.Character.Torso.Fire:Play() end)
Thanks!
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() --Capitalise the Connect, as connect is deprecated. remoteEvent:FireServer() --We won't need any parameters except the player. end)
Server Script
local remoteEvent = game.ReplicatedStorage.RemoteEvent remoteEvent.OnServerEvent:Connect(function(player) --This is what we need. player.Character.Torso.Fire:Play() --I'm assuming you're using R6. end)