So i'm trying to learn how remote events work and i'm seeing that you can send data, I'm having trouble with this,
This is my local script, in StarterPack
local usi = game:GetService("UserInputService") usi.InputBegan:Connect(function(imput, typing) if typing then return else if imput.KeyCode == Enum.KeyCode.F then local x = game.ReplicatedStorage.RemoteEvent x:FireServer(workspace.Baseplate.Color, game.Players.LocalPlayer.Name) end end end)
When you press F the local script executes a remoteevent serversided.
This is my server script
local event = game.ReplicatedStorage.RemoteEvent event.OnServerEvent:Connect(function(basecolor, plrname) print(basecolor) print(plrname) end)
When i press F, it prints 2 sets of information, But not what i want, first it prints my characters name(Entity_246) then coordinates (0.388235, 0.372549, 0.384314), What am i missing? are these values preset by Roblox and they have to be preset, or can i customize them?
Thanks for any help :)
Ah yes.
Roblox by default includes the argument of the player as the first one.
local event = game.ReplicatedStorage.RemoteEvent event.OnServerEvent:Connect(function(Player, basecolor, plrname) print(basecolor) print(plrname) end)
That will work, you must specify player argument even if you don't use it