I got an error trying to use a RemoteFunction from server to client to try and create a Hitmarker. I couldn't find any way to fix it, so i decided i was going to ask it here.
Error:
Argument 1 missing or nil
Server Script:
local humanoid = part.Parent:FindFirstChild("Humanoid") if humanoid then game.ReplicatedStorage.Hitmarker:InvokeClient() if part.Name == "Torso" then Damage = 8 elseif part.Name == "HumanoidRootPart" then Damage = 8 elseif part.Name == "Head" then Damage = 15 else Damage = 5 end humanoid.Health = humanoid.Health - Damage end
Local Script:
local mouse = game.Players.LocalPlayer:GetMouse() mouse.Icon = "http://www.roblox.com/asset?id=117431027" game.ReplicatedStorage.Hitmarker.OnClientInvoke = function() mouse.Icon = "http://www.roblox.com/asset/?id=1324497959" end
Any help would be appreciated!
You have to pass a player instance to InvokeClient()
if humanoid then local player = game.Players:GetPlayerFromCharacter(part.Parent) game.ReplicatedStorage.Hitmarker:InvokeClient(player)