Boss attack Affect wont popup

Hello! So I’m trying to make a Boss Battle, I made a Explosion for when the boss Punches, The issue is that whenever I try to set the Position for the Explosion it always errors, here’s the error and the script.

  09:50:26.032  Workspace.Dummy.AttackHandler:36: invalid argument #3 (Instance expected, got Vector3)  -  Server - AttackHandler:36
local Boss = script.Parent
local character = script.Parent
local humanoid = character:FindFirstChild("Humanoid")
local AttackList = {"Punch", "Stomp", "Drill"}
local ChosenAttack = nil
local IdleAnim = script.Idle
local PunchAnim = script.Punch
local StompAnim = script.Stomp
local DrillAnim = script.Drill
local DeathAnim = script.Death


local animationTrack = humanoid:LoadAnimation(IdleAnim)

animationTrack:Play()

while true do
	wait(5)
	ChosenAttack = AttackList[math.random(1, #AttackList)]
	if ChosenAttack == "Punch" then
		humanoid:LoadAnimation(PunchAnim):Play()
		wait(1)
		local exp = Instance.new("Explosion")
		exp.Name = "Explosion"
		exp.Parent = Boss["Right Arm"].Position
		exp.Position = Boss["Right Arm"].Position
		wait(1)
		exp:Destroy()
	end
	
	if ChosenAttack == "Stomp" then
		humanoid:LoadAnimation(StompAnim):Play()
		wait(1.12)
		local exp = Instance.new("Explosion")
		exp.Name = "Explosion"
		exp.Parent = Boss["Right Leg"].Position
		exp.Position = Boss["Right Leg"].Position
		wait(1)
		exp:Destroy()
	end
	
	if ChosenAttack == "Drill" then
		humanoid:LoadAnimation(DrillAnim):Play()
		wait(3.2)
		local exp = Instance.new("Explosion")
		exp.Name = "Explosion"
		exp.Parent = Boss["Right Arm"].Position
		exp.Position = Boss["Right Arm"].Position
		wait(1)
		exp:Destroy()
	end
	if Boss.Humanoid.Health == 0 then
		humanoid:LoadAnimation(DeathAnim):Play()
		break
	end
end

You are trying to parent to a Vector3 Value. Remove the .Position.

2 Likes

exp.Parent = Boss["Right Leg"]
No reason for the position to be there at all

1 Like

LOL I FEEL SO DUMB NOW

this was such a easy fix ;~;

thanks

1 Like

@1000knives and @cryptedhost

Is their a way to make the Boss Invisible When using attacks?

Just loop through all the body parts and set its Transparency to 1.

How would I loop through them?

and how would just making their transparency invisible protect the boss from its own attacks?

I’m sorry, do you want to make it invisible (completely transparent and not viewable) or INVINCIBLE (immune to taking damage)?

1 Like

I’m trying to make the boss invincible to taking damage yes

@cryptedhost

If you want it to not take damage from its own attacks, just have a check in your attacking script (of the boss) that checks if the target that is going to be damaged is the boss itself. Here’s a function you could use.

function CheckIfSelfAttack(Attacker, Target) -- Where Attacker is the humanoid of the person attacking and Target is the humanoid of the person being attacked
    if Attacker:GetFullName() == Target:GetFullName() then
        return true
    else
        return false
    end
end)

You could use this to check if the target is the attacker (the boss, in this case). And if it returns true, just cancel the damage dealing part of the script.

Is their a way I can make a Forcefield?