Hello I am trying to make a glory kill script but as of right now I just have a script that fires a remote event when the key F is pressed. Whenever it gets it on the server it doesn’t print and insteads error with the error being the title.
function attack(player, target)
if (player.Character.HumanoidRootPart.Position - target.Position).Magnitude < 2 then
if target.Name == "Humanoid" then
print("yes")
end
end
end
script.Parent.RemoteEvent.OnServerEvent:Connect(attack)
thats probably my issue because I dont have a target on client.
local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.F then
script.Parent.RemoteEvent:FireServer()
end
end)
Im still learning remote events and this is my first time using them without a vial tutorial
Yeh thats your issue, you dont pass an argument for target so target is nil, and nil has no properties or attributes called Position, or anything for that matter