I have a tool, that removes 18 hp from the player that gets clicked on. If the thing that gets clicked on doesn't have a humanoid, it will print("No humanoid found")
But now, it prints "No humanoid found" although I click on a player.
Tool script: (Client side, local script)
tool = script.Parent player = game.Players.LocalPlayer tool.Equipped:Connect(function(mouse) mouse.Icon = "http://www.roblox.com/asset/?id=2312592107" mouse.Button1Down:Connect(function() game.Workspace.KillExplosion.KillExplosionCreate:FireServer(mouse.Target, tool.Handle) end) end)
Server script: (Server side, normal script)
debounce = false script.KillExplosionCreate.OnServerEvent:Connect(function(player, target, tool) if debounce == false and target.Parent:FindFirstChild("Humanoid") == true then print("found humanoid") debounce = true wait(1) debounce = false else print("no humanoid found") end end)
Thank you for help!
remove the == true at findfirstchild, a humanoid isnt a true or a false value
debounce = false script.KillExplosionCreate.OnServerEvent:Connect(function(player, target, tool) if debounce == false and target.Parent:FindFirstChild("Humanoid") then print("found humanoid") debounce = true wait(1) debounce = false else print("no humanoid found") end end)