I was wondering if i can send different information through a RemoteEvent, Its hard to explain so ill just show through script.
Client Script
--Client
--J
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputServer = game:GetService("UserInputService")
local plr = Players.LocalPlayer
local event = ReplicatedStorage:WaitForChild("event")
UserInputServer.InputBegan:Connect(function(input, IsTyping)
if IsTyping then
return
elseif input.KeyCode == Enum.KeyCode.J then
local J = "J"
event:FireServer(J)
print("Fired Server")
end
end)
Client Script
--Client
--K
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputServer = game:GetService("UserInputService")
local plr = Players.LocalPlayer
local event = ReplicatedStorage:WaitForChild("event")
UserInputServer.InputBegan:Connect(function(input, IsTyping)
if IsTyping then
return
elseif input.KeyCode == Enum.KeyCode.K then
local K = "K"
event:FireServer(K)
print("Fired Server")
end
end)
Server Script
--Server
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local event = ReplicatedStorage:WaitForChild("event")
event.OnServerEvent:Connect(function(J, K)
if J then
print("J was clicked")
elseif K then
print("K was clicked")
end
end)
When I play the game and Click K It just ends up saying " J was clicked" Although I clicked K. How would I do this? Is it even possible?

8 comments
I would highly recommend renaming your event to something specific.
Would i need to Specify what key is in the LocalScript?
No
You already did since you sent the string over to the server script
Where did you find/get "key " from?
its the parameter J or K you sent
the parameter name doesnt have to be exactly what you name it when you fire it
ohh Alrigh,t thankyou