Running it through one event is worse (in most cases)
Having multiple events keeps it more organized because you already know what parameters you are going to send/recieve
Running it through one event is worse (in most cases)
Having multiple events keeps it more organized because you already know what parameters you are going to send/recieve
Oh. I didnāt know, Iām new to coding so Iām just kind of trying to make sense of it all on the fly. Forgive me if I say some braindead things.
Itās fine, i also suck at it lol. I would watch a tutorial on remote events so that you can get a better idea on how they work.
Iām good at Client > Server but this is my first time trying to do Client > Server and back to Client
If you need Client > Server > Client, use RemoteFunctions
. RemoteEvents
are one-way
Oh ok. It is pretty much the same except that :FireServer() doesnāt need a player argument.
Oh RemoteFunctions, let me look up their API
Remote events are one way? You can use :FireServer or :FireClient on them though and you can provide parameters.
One way as in client > server and vice-versa. RemoteEvents
donāt return anything
Adding on to this, Iām pretty sure this could sort of āoverloadā that one event and is generally not good practice. Think of remotes like a bridge. It would be better to have multiple bridges where all the events cross instead of one bridge wheere all the events are crammed together.
Youāre right, that makes a lot of sense.
I got the Client > Server > Client system working, now I just need to rough out the edges but thank you to all of you. It genuinely means a lot to me
You can pass all kinds of perimeters in one FireServer
-- local script in StarterPlayerScripts or StarterGui
local rs = game:GetService("ReplicatedStorage")
local DomainEvent = rs:WaitForChild("DomainEvent")
task.wait(4)
DomainEvent:FireServer("DomainExpansion", "2nd perimeter", "3rd perimeter", 4)
-- server script in ServerScriptService
local rs = game:GetService("ReplicatedStorage")
local DomainEvent = rs:WaitForChild("DomainEvent")
DomainEvent.OnServerEvent:Connect(function(Player, Key1, Key2, Key3, Key4)
print(Player)
print(Key1)
print(Key2)
print(Key3)
print(Key4)
end)
1st one is always the player ā¦
Oh I see so I can just use it to pass along whatever information I want, thatās very very helpful
Seriously? Thatās kind of stupid.
Ya, always break questions down into prints and focus on just that, then you know for sure. Notice I didnāt even declare the local player at all. Server knows who it came from.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.