#remote event parameter issues

1 messages · Page 1 of 1 (latest)

cunning gate
#

i think it might be bc i have too many parameters, but idk if there is a cap. btw, if i remove the plr parameter, it just says cannot cast value to object

localscript recieving event:

local guiOpen = game.ReplicatedStorage.remotes.guiAutoOpen

local machineInUse = "1"

guiOpen.OnClientEvent:Connect(function(plr, machineNum, churn, pour, store)
    machineInUse = machineNum
    print(store)
    script.Parent.Enabled = true
    script.Parent.churn.Text = churn
    script.Parent.pour.Text = pour
    script.Parent.store.Text = store
end)

serverscript sending event:

activateProx.Triggered:Connect(function(player)
    guiOpen:FireClient(player, machineNum, pourPart, churnPart, storePart)
end)

everything here is defined correctly, tested using print beforehand ^^^

gaunt pasture
#

OnClientEvent doesn't get passed the player parameter

cunning gate
#

wdym?

#

o wait a minute i didnt even specify the issue ._.

#

store is just returning nil

gaunt pasture
# cunning gate wdym?

Exactly what I said. FireClient takes the player as the first argument to know who to send it to. It does not get passed to the connected function. So plr is actually machineNum, machineNum is actually pourPart, etc

cunning gate
#

o ok

#

i get it now