So I’m trying to make a game about running which involves making almost everything about running client-side.
I want every client to see what a player does and the VFX so I proposed this method for every input a player would have in my game.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Remotes = ReplicatedStorage.Remotes
local Actions = {}
Actions.Init = function()
Remotes.ToServer.OnServerEvent:Connect(function(player,signal)
if signal == "Enable" then
Remotes.ToClient:FireAllClients("Enable")
elseif signal == "Disable" then
Remotes.ToClient:FireAllClients("Disable")
elseif signal == "Increase" then
Remotes.ToClient:FireAllClients("Increase")
elseif signal == "Decrease" then
Remotes.ToClient:FireAllClients("Decrease")
end
end)
end
return Actions
I don’t think this is the write way to code at all. I saw Suphi Kaner’s tutorial on Client Replication but it taught me nothing I didn’t already now.
I basically fire to the server whenever a player presses a button and it fires to the server for things just to be sent back.
I think this will make my game more laggy and its not very nice to look at.
Is this right?