im creating a drop (inventory dropping) system but idk how i go to client → server
please help
im creating a drop (inventory dropping) system but idk how i go to client → server
please help
but i need
only explatations (because i don’t remember)
Doesn’t the Creator Hub explain it enough?
no because it connects client --> server
and server --> server
What do you even mean by that. There 4 Instances made specifically for what you need, although you can’t use the same one.
no not that the script goes to client -> server
and server -> client
example:
client:
server:
and to say the examples are screenshoots
You want the client script to send something to the server or connect to the server to get for example a value and return it back?
you can do this
make a RemoteFunction
on a clientsided script:
local remote = path.to.remotefunction
-- local script code
remote:InvokeServer("argument 1", "argument 2", "you can add as many as you like") -- this is when you want the server sided code to run
-- more local script code (yes, this part will wait for the server to be done before running)
local remote = path.to.remotefunction
remote.OnServerInvoke = function(player, all, the, arguments) -- players argument is there **by default**, you don't need to put in localplayer when doing InvokeServer
local success, result = xpcall(function()
-- server sided code here
end, warn) -- all errors turn to warnings here because xpcall
return if success and result~=nil then result else true -- uhh i'm too lazy to explain this here
end
is a little true but here the explanation:
the guiButton connects to server to drop an item so not only the client can see it but even all other players