I made a bandage script a little while ago and I cannot understand why it prints an error. Also I'm clicking on a damaged dummy.
Local script
local RemoteEvent = script.Parent.RemoteEvent
RemoteEvent.OnServerEvent:Connect(function(player, Humanoid)
print(Humanoid)
Humanoid.Health = 10
script.Parent.Sound:Play()
player.Character.CameraEvent:FireClient()
wait(3)
player.Character.CameraEvent:FireClient()
end)
Server script
local Animation = script.Parent.Fidgeting
local Player = game.Players.LocalPlayer
script.Parent.Activated:Connect(function()
local Target = game.Players.LocalPlayer:GetMouse().Target
if Target.Parent:FindFirstChild("Humanoid") and Target.Parent.Humanoid.Health < Target.Parent.Humanoid.MaxHealth then
script.Parent.RemoteEvent:FireServer(Player, Target.Parent.Humanoid)
Player.Character.Humanoid.Animator:Destroy()
Instance.new("Animator").Parent = Player.Character.Humanoid
Player.Character.Humanoid.Animator:LoadAnimation(Animation):Play()
end
end)
Prints this:
levka_321
Health is not a valid member of Player "Players.levka_321"