ChildAdded or RemoteEvent

[Thought]
Why use RemoteEvent for this instance? When I can get away without RemoteEvent.

[Server Side]
When a player pickup a prefab/Model using ProximityPrompt the Server find the object on ServerStorage, clone a Tool and a Frame, place it into the player Backpack and ScrollingFrame on the server side, which triggered ScrollingFrame.ChildAdded:Connect() on the client side.

[Client Side]
Using .ChildAdded:Connect() to detect if the a child is added to ScrollingFrame if yes then do stuff…

[Why not use a remote event]
Easier and clean and maybe safer? Just to detect if something change on the client and for security, the Server is not letting the Client decide what give to the client.

I am not an expert coder or good at Lua or Roblox networking between server and client for the matter. Am I doing this all wrong and over looking some stuff, for the connection and RemoteEvent is the better option?

One thing I can come up that could be an issue later is, as the number of player increases, the server will work harder.

Give me thoughts on this.

--Server Script
local ProximityPromptService = game:GetService("ProximityPromptService")
local module= require(script.module)

local function onPromptTriggered(promptObject, player)
	module.promptTiggeredActions(promptObject, player)
end

--Module Script [Server Side]
local module= {}

function module.promptTiggeredActions(promptObject, player)
	--Find object in ServerStorage
	--Clone it
	--Place it into the client on the server side
end

return module
--Local Script [Example]
local scrollingFrame = script.Parent

local function UpdateInventory()
    --Update Inventory
end

scrollingFrame .ChildAdded:Connect(UpdateInventory)

Personally, I feel that if the ChildAdded function is working fine, then I don’t see the need to take the extra step of adding a RemoteEvent into the mix.

Sweet thanks, ill use this until I run into problems down the road, then I’ll just update it.

1 Like