Hello, I'm having issues with sending multiple parameters trough a server event. It just doesn't works, and I'm suffering because of this problem. Here are the scripts:
local script:
local wood = Inv.Materials.Wood
local oldWood = 0
wood.Changed:Connect(function(player,newv)
print(oldWood)
local event = game.ReplicatedStorage.Inventory.Wood
event:FireServer(newv,oldWood)
wait()
oldWood = newv
end)
server script:
local Inventory = game.ReplicatedStorage.Inventory
local wood = Inventory.Wood
wood.onServerEvent:Connect(function(player,newv,old_Wood)
print(newv) --123
print(old_Wood) --124
local value = newv - old_Wood
print(player.."'s just got "..value.." Wood! Now he has "..newv.." Wood.")
end)
Output: 17:40:49.263 nil - Server - Inventory:123 17:40:49.263 0 - Server - Inventory:124

4 comments
So I cant get a variable trough the fireserver, only a parameter?
Tho, the oldvalue is working, I have issues with the newvalue (newv)
Sry, i didn't notice that I had the player in the change function's parameters.
parameters are same variables, they both hold values and you can pass them to :FireServer, what exact issues are you having right now? ~~~~~~ oki oki