Basically, the LocalScript's variable is chosenkey when i define it on ServerScriptService as chosen it still prints Hello why?
Am I doing anything wrong, please someone take your time and explain if so
ServerScriptService
remoteEvent.OnServerEvent:Connect(function(player, chosen)
print(chosen)
if chosen == "A" then
print("hello")
end
LocalScript
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
local list = {"A"}
local chosenKey = list[math.random(1, #list)]
remoteEvent:FireServer(chosenKey)
Output: Hello

1 comment
EEnergy8 it doesnt matter what you call the variable you fire, if you have it as a parameter thats not player, the server will assume that the variables correlate with each other