Basically this is a counter move from my pvp game, and this script checks when the plr gets dmg when in counter move. The issue is when the skill is activated, the plr became invincible to all sort of dmg(which uses touched event to trigger the damaging)
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried looking for solutions but i can not find anything related
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- This is an example Lua code block
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
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:
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
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
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?
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)
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)