Script is broken

	repeat wait(1) until script.Check.Value == true
	if script.Parent.Parent.Humanoid.Health <= 1 then
		script.Check.Value = false
		local playername = script.Hitter
		local plr = game.Workspace:FindFirstChild(playername.Value)
		plr.Buster.KillSFX:Play()
		plr.Buster.Kills.Value += 1
		print("he ded")
	else
		print("no kills lol")
		wait (5)
		script.Check.Value = false
	end
end
Could anybody explain why this is not working? Whenever the player gets hit it will trigger a boolvalue and will have 5 seconds to check if they player dies in less than 5 seconds it will give them a kill and disable the check value? help please?
3 Likes

I’m pretty sure after the player dies their humanoid is removed… I would decrease the wait time. If it’s not the humanoid getting destroyed it could be respawn time… not sure I’m new to posting here

2 Likes

Where is the script located? In the Player folder in the explorer, or in the actual player in the workspace?
Is it a local script or a server script?

Do you just have playername.Value in the workspace?
Why not put that value into script.Parent.Parent.Humanoid so when you are searching for the Health you can search for the Kills.Value.

2 Likes

its in startercharacterscripts also its server script

2 Likes

Does it give you an error in output?

2 Likes

What type of value is Kills.Value? You should be using an IntValue for it since it isn’t decimal related.
Is Check a child of the script or something else (script.Check.Value).

When this section of code runs it only runs once, it never runs after that, unless there is more code before the first line that you haven’t included.

You can also try putting print statements after the first line to see if the values are changing the way you need them to.

repeat wait(1) until script.Check.Value == true
print(script.Check.Value, "   ", script.Parent.Parent.Humanoid.Health) -- you could also try printing their name to see if that registers properly too.

can u send the error so i can help

1 Like

I fixed it already, no need to worry now!

1 Like

Please post how you fixed it.
It my help someone out in the future who is having the same problem.

Honestly, i do not know how it fixed… It kind of just did it by itself, y’know?

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.