I have a script that is supposed to summon a minion at a position in a boss battle, but i keep getting the “Unable to cast Instance to CoordinateFrame” error, please help me fix this
Heres the script:
function Attack(nothing,andagainnothgi)
wait(3) – this is the cooldown of how much time to wait till they spawn
local minion = game.ReplicatedStorage:WaitForChild(“Goblin”):Clone() – change yourminion to your minion
minion.Parent = script.Parent.Parent.Parent
local spawnl = math.random(1,2) – change 2 to how much spawn locations there areif spawnl == 1 then
minion:PivotTo(script.Parent.Parent.Parent.spawnlocation1) – same as the top one – change spawnlocation1 to your spawn you want
minion.AI.Enabled = true
elseif spawnl == 2 then
minion:PivotTo(script.Parent.Parent.Parent.spawnlocation2) – same as the top one
minion.AI.Enabled = true
end
end
return Attack