Player somehow becomes invincible

Pretty sure the number increases naturally.

so basically wat happens here is the red part i touched is scripted to dmg the plr after 1 sec and the counter worked. But when tested with the red ball(and other skills) it just went right through. This is just a budget game i make 4 fun tho c:

Is the code not supposed to prevent damage during the counter?

Maybe you character dies and set the health value back to a positive number and glitches the character?? We need more information, do you change the collision group in some script? can we see a bit of code of the red orb?

i recomend adding a boolean value inside the character, and when a projectile wants to damage the player, checks the boolean, if its true it does not, if its false it does, but you will have to set that value from the server side

1 Like

yeah but it also triggers the counter which is that big white ball thing that deals dmg and stun

local tagged = {}

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		local team = nil
		if plr then 
			team = plr.Team.Name 
		end
		
		if plr then
			if team ~= script.Parent.Team.Value then
				local check = true
				for i,obj in pairs(tagged) do
					if obj == hit.Parent then
						check = false
					end
				end
				
				if check then
					hit.Parent.Humanoid.Health -= script.Parent.DMG.Value
					table.insert(tagged,hit.Parent)
				end
				
			end
		else			
				local check = true
				for i,obj in pairs(tagged) do
					if obj == hit.Parent then
						check = false
					end
				end

				if check then
					hit.Parent.Humanoid.Health -= script.Parent.DMG.Value
					table.insert(tagged,hit.Parent)
				end
		end
	end
end)

the hit script of red orb here and no i dont change collision group

2 Likes

the red orb is hitting the sword tool handle maybe and does not hit the character?
how do you move the orb? make some print to know in the code

no i tried multiple angles off cam and also tried it with some big aoe moves and it still didnt work. i use tween to move em

1 Like

mmm i dont know, maybe try commenting (ctral + /) this part of code

char.Humanoid.Health = lastHP

but maybe the problem is in another script, or in a part the screenshot does not show

1 Like

what is that clone variable? and are you changing some sort of collision of the player? do projectiles hit the character and dont do damage or dint hit at all?

1 Like

I’m cloning the red ball from server storage, and projectiles hits the char and deal no dmg

2 Likes

did u watch the vid i sent tho

1 Like

yes and im thinking why does not do damage but i have no clue

2 Likes

yeah i tried printing it out and it really did not touch when the other plr was in counter mode

1 Like

maybe it hits the handle?
try

local plr = game.Players:GetPlayerFromCharacter(hit.Parent) or game.Players:GetPlayerFromCharacter(hit.Parent.Parent) or game.Players:GetPlayerFromCharacter(hit.Parent.Parent.Parent) 

or maybe its the way you move the orb buts its weired (like teleporting it with cframes)

2 Likes

welp it doesnt work :c dont really think its the way it moves tho cus it does touch the torso

2 Likes

Well, the best that you can do now is place a lot of prints or warns around the code and figure why they hit but dont deal damage, or if they deal damage and the character heals itself (in both scripts)

1 Like

there is something interesting i just discorvered is that when i strengthen the counter time to 10s, it started to work after 1s of invincibility( UPDATE: it doesnt work rn bruh), this makes things even weirder lol.

1 Like

A lil update: i remove the anchored when activating the skill and it worked, i put it there cus i didnt want the plr to get knocked back when successdfully counter a move. So anchoring the humanoidRootPart messes up the collision or what lol

1 Like

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