[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)