when i fire the server (event in a local script) and reference the player and another object it only references both as a player instead of the object i would want it to reference.

know how to fix this?
when i fire the server (event in a local script) and reference the player and another object it only references both as a player instead of the object i would want it to reference.

know how to fix this?
When you fire a remote event from the client, the first parameter is automatically filled in for you. The server is actually getting 3 parameters, even though you think you’re only sending two:
What you think you’re sending: localplayer, enemyhum
What you’re actually sending: player, localplayer, enemyhum
Edit: I can’t tell for sure based on the information provided, but generally speaking, it is not secure to trust a client’s custom implementation about important information such as which player is firing an event. Roblox’s automatically provided player parameter is (almost) guaranteed to be correct and verified, and is what you should be using.
Any reason as to why you’re passing a function value to FireServer? Also when you fire the server the player instance pertaining to the client of which fired the server locally is automatically passed as an argument to the FireServer() call and subsequently any callback function connected to the corresponding OnServerEvent event listener requires an additional declared parameter to handle this received object (value). Your server script & local script should look similar to the following.
--from the client
game.ReplicatedStorage.damagefat:FireServer(enemyhum)
--on the server
game.ReplicatedStorage.damagefat.OnServerEvent:Connect(function(player, enemyhum)
--do stuff
end)
The comments above are correct but here’s another reply.
It looks like the information you’re sending to the RemoteEvent is the return value of getdata.
Not sure what you’re sending to getdata (the variables “player” and “enemyhum”) but to me it looks like nothing is being sent.
The reason you’re receiving both as a player is because you’re sending the player twice.
When you :FireServer(), the first argument is automatically identified as the player. So what you’re sending is :FireServer(player, player, enemyhum).
I would do this instead:
--I recommend removing getdata, it's an unnecessary middleman.
local function getdata(enemyhum)
--[enemy.Humanoid = enemyhum] // If you want the enemy to take damage, do it on the server.
return enemyhum
end
-- Player is already identified (as stated by others) when firing, so we only need the value(s) after.
game:GetService("ReplicatedStorage").damagefat:FireServer(getdata)
or,
game:GetService("ReplicatedStorage").damagefat:FireServer(enemyhum)
I hope this is/was helpful to you/anyone reading, goodluck on your game!
Duke 