Remote.OnServerEvent:Connect(function(player, mousePosition, key, character)
if not AttackAble then return end
print('throw')
AttackAble = false
if Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R15 then
Remote:FireClient(getPlayer(), "PlayAnimation", "Animation")
end
local targetPos = mousePosition.p
local lookAt = (targetPos - Character.Head.Position).unit
Toss(lookAt)
LeftDown = true
end)
Remote.OnServerEvent:Connect(function(player, mousePosition, key, character)
if not AttackAble then return end
print('throw')
AttackAble = false
local Humanoid = character.Humanoid
if Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R15 then
Remote:FireClient(getPlayer(), "PlayAnimation", "Animation")
end
local targetPos = mousePosition.p
local lookAt = (targetPos - character.Head.Position).unit
Toss(lookAt)
LeftDown = true
end)
That is not true. You can pass a Model to the server.
My solution above would have worked and would be useful if this was for a weapon. (if you wanted to get the player’s enemy’s character.) If this were for a weapon, make sure that you check the validity of the character provided.
This only worked because it happens to be that the character you are passing through the RemoteEvent is the sender’s character. If you are trying to make something happen to the sender’s character, then use player.Character, if not do not use it.
I would like to note that the only reason why your script didn’t work is because you had a capital c on the word character.
I stated the use cases for my solution. It would not be an extra variable in the use case I provided. Considering we have no extra context, one may think that it is for a weapon.