Do i need to learn remote events/ Remote functions if i want to make better game is it essential i see a bunch of other coders doing it

is learning how to code with remote functions and remote event something that is important or not i just cant seem to understand how to do them if i don’t get them should i just not learn them i already know how to use module scripts :thinking:

Yes, absolutely yes. Remotes have a significant part in your game, they can help you so much.

They’re connecting the client with the server [or opposite], and can save lot of problems. Use them correctly and wisely.

1 Like

90% of the time i try to use them in my code they don’t work

Yes it’s very important. Most games won’t function without it and you can’t access the client stuff without using them

1 Like

Maybe you are not using them right

But if it’s a simple game , like an obby, then you don’t have. [Depends if you add stuff that require remotes[

like i have been trying to figure out how to get a key pressed in client via local script to effect something in the server side

Can you show us the Code? We might be able to help

ok i guess i will be learning them then

game:GetService(“UserInputService”).InputBegan:connect(function(input,gameProcessed)
if input.KeyCode == Enum.KeyCode.E then
–code here
end
end)

There is nothing wrong with this code Send us the full code if you want

local event = game:GetService("ReplicatedStorage"):WaitForChild("Event")

game:GetService(“UserInputService”).InputBegan:connect(function(input,gameProcessed)
    if input.KeyCode == Enum.KeyCode.E then
        event:FireServer() -- if it's a remote event, if it's a function do :InvokeServer()
    end
end)

then on the server do :

game.ReplicatedStorage.Event.OnServerEvent:connect(function(player)
--what goes here, will be shown to everyone
end)

i think I’m fine i just wanted to know how useful Remote event and functions where

oh it’s that easy that’s not to bad

Please notice to the last edit I did,

Don’t forget to add ‘player’ as the 1st argument on the server :
game.ReplicatedStorage.Event.OnServerEvent:connect(function(player)

With that, you could print the player’s name, kill the player, and so much more.

1 Like

https://developer.roblox.com/en-us/api-reference/datatype/RBXScriptSignal

Remember to use Connect() in place of connect().

Does it have case sensitive? By far it worked perfectly in both cases

i tried the code it was amazing

connect() is deprecated according to the wiki