Okay, I'm still learning a lot so please dont be mad. So im trying to pass a variable from a local script with a remote event to a server script. Heres an example:
game.ReplicatedStorage.givemoney:FireServer(hitHumanoid) --local script
Server script:
game.ReplicatedStorage.givemoney.OnServerEvent:Connect(function(hitHumanoid) if hitHumanoid.Health <= 0 then hitHumanoid.Parent.creator.Value = "example.." end end)
**The problem is that the variable hit Humanoid will mark the player instead of that variable. *14:13:43.298 - Health is not a valid member of Player Does anyone know how to fix it?***
Remote event fired from client to server will have the player that fired it as the first argument, that means the player is assigned to "hitHumanoid" variable, you can fix it like this, also you should format your code:
game.ReplicatedStorage.givemoney.OnServerEvent:Connect(function(Player,hitHumanoid) if hitHumanoid.Health <= 0 then hitHumanoid.Parent.creator.Value = "example.." end end)