FeedBack On My Replication Framework

Please consider using the “What are you working on currently?” topic!
Hello People, I’ve Created This Client Sided Replication On Roblox Thats Makes It So That Stuff Can Be Viewed On All Clients But Not The Server.

Why Would You Want To Do This?
I Did This Because It Decreased Server Load So It Wont Cause High Ping.

The Script Works Like This
Client Gives Data To The Server
Server Receives The Data
Server FiresAllClients
Items Show On Every Client

Example
First Client Script Goes Like This

local player = game.Players.LocalPlayer
local RS = game:GetService("ReplicatedStorage")
local RockMod = require(RS:WaitForChild("Moudles"):WaitForChild("Effects"):WaitForChild("RockModule"))
local remotes = RS.RemoteHandler
local remote = remotes.ReplicationServer

while task.wait(0.5) do
	local action = "Rock"
	local Item = player.Character:FindFirstChild("HumanoidRootPart")
	local Var3 = "Crater"
	local Var4 = "Small"
	-- filler dont need local Var5 = "Explosion"
	-- filler dont need local Var6 = "Medium"
remote:FireServer(player,action,Item,Var3,Var4)

end

Once The Remote Event is Fired The Server receives All Of this Data And Then FiresAllClients

local RS = game:GetService("ReplicatedStorage")
local moudles = RS.Moudles
local rockmod = require(RS.Moudles.Effects:WaitForChild("RockModule"))
local remote = RS.RemoteHandler.ReplicationServer

remote.OnServerEvent:Connect(function(player,plr,Action,Item,Function,Function2)
	print("Action Recieved")
  print(Action)
	RS.RemoteHandler.Replication:FireAllClients(Action,Item,Function,Function2)
	
	
	
end)

After This A local Script Detects This Script And Finds Out What Event The Player wants to do

local rs = game:GetService("ReplicatedStorage")
local remotes = rs.RemoteHandler
local Replication = remotes:WaitForChild("Replication")

Replication.OnClientEvent:Connect(function(action,Item,var3,var4)
print("Replication Recieved")
 
	if action == "Rock" then
		print("Action Rock")
		local module = require(rs.Moudles.Effects:WaitForChild("RockModule"))
		if var3 == "Crater" and var4 == "Small" then
			module.Crater(Item.CFrame,7,7,10,true)
	
		end
		if var3 == "Crater" and var4 == "Medium" then
			module.Crater(Item.CFrame,10,10,15,true)
		end
		if var3 == "Crater" and var4 ==  "Big" then
			module.Crater(Item.CFrame,20,20,25,true)
		end
	if var3 == "Explosion" and var4 == "Small" then
		module.Explosion(Item.CFrame,5,2,3,false)
	end
		if var3 == "Explosion" and var4 == "Medium" then
			module.Explosion(Item.CFrame,10,3,4,true)
		end
		if var3 == "Explosion" and var4 == "Big" then
			module.Explosion(Item.CFrame,20,3,5,false)
		end

	end
	
	
	
end)

Example Video

I Made This For BattleGround or games that use too much effects Lmk if i should change things and make this better

This is my first try on client replication I need feedback on how to make this more optimized.

Sorry, I think this post belongs in #help-and-feedback:code-review.

1 Like

Thanks i Changed It right now!

1 Like