This topic is very similar to this.
When I load the game up it works fine for a couple of minutes until you get to the boss fight scene.
Every single time, when the Boss shoots lasers out of his eyes or when he goes and destroys the ground, the game crashes.
Every.
Single.
Time.
Whats evn more annoying is that it doesn’t just crash my game, it crashes studio too.
– Code where it
local po = PrimaryPart.Position
SPIDER.Static.Body.Charge:Play()
SPIDER.Static.L.Attachment.Zoom.Enabled = true
SPIDER.Static.R.Attachment.Zoom.Enabled = true
local PosTarget = PrimaryPart.Position
local LeftLaser = ReplicatedStorage.Parts.Laser:Clone()
local RightLaser = LeftLaser:Clone()
local distL = SPIDER.Static.L.Position - PrimaryPart.Position
local distR = SPIDER.Static.R.Position - PrimaryPart.Position
LeftLaser.CFrame = CFrame.lookAt((PrimaryPart.Position + SPIDER.Static.L.Position) / 2, SPIDER.Static.L.Position)
RightLaser.CFrame = CFrame.lookAt((PrimaryPart.Position + SPIDER.Static.R.Position)/ 2, SPIDER.Static.R.Position)
LeftLaser.Size = Vector3.new(2,2,distL.Magnitude)
RightLaser.Size = Vector3.new(2,2,distR.Magnitude)
task.wait(4)
LeftLaser.Parent = workspace.Effects
RightLaser.Parent = workspace.Effects
SPIDER.Static.L.Attachment.Zoom.Enabled = false
SPIDER.Static.R.Attachment.Zoom.Enabled = false
game.Debris:AddItem(LeftLaser,1.5)
game.Debris:AddItem(RightLaser,1.5)
for i = 1 , 10 do
Instance.new("Explosion",workspace.Effects).Position = po
task.wait(0.1)
end
wait(5)
And sometimes also here
local Arm = Arms[Randomizer:NextInteger(1,2)]
Raise = TweenService:Create(
Arm,
RaiseTweenInfo,
{
Position = character.PrimaryPart.Position + Vector3.new(0,100,0)
}
)
Slam = TweenService:Create(
Arm,
SlamTweenInfo,
{
Position = character.PrimaryPart.Position
}
)
Reset = TweenService:Create(
Arm,
RaiseTweenInfo,
{
Position = Arm.Position
}
)
Raise:Play()
Raise.Completed:Wait()
task.wait(1)
Slam:Play()
Slam.Completed:Wait()
local meshClone = Smash:Clone()
meshClone.Position = character.PrimaryPart.Position
meshClone.Parent = workspace.Effects
meshClone.ParticleEmitter:Emit(100)
meshClone.Attachment.Explosion:Play()
local Explosion = Instance.new("Explosion")
Explosion.BlastRadius = 16
Explosion.BlastPressure = 10000
Explosion.DestroyJointRadiusPercent = 0.5
Explosion.ExplosionType = Enum.ExplosionType.Craters
Explosion.Position = character.PrimaryPart.Position
Explosion.Visible = false
Explosion.Parent = workspace
local MeshFX = TweenService:Create(
meshClone,
ExpandTweenInfo,
{
Size = Vector3.new(20,256,20),
Transparency = 1
}
)
MeshFX:Play()
task.wait(3)
Reset:Play()
Reset.Completed:Wait()
Raise:Destroy()
Slam:Destroy()
meshClone:Destroy()
MeshFX:Destroy()
If anyone knows why this happens please let me know why. It use to work but now it doesn’t and I am absolutely stunped as to why this happens.
I am using team create it could be that but I still don’t know why.