I am making a boss fight, but there is one simple bug that just isn’t working. It is ignoring the if statement under the while loop. I have a script that makes the boss constantly rotate around the island until it is venerable.
local monster = script.Parent
local center = Vector3.new(84.073, 77.183, -3937.575)
local distanceFromCenter = 750
local speed = 0.07
local RunService = game:GetService("RunService")
local function MoveDown()
while wait(0.1) do
script.Parent:SetPrimaryPartCFrame(script.Parent:GetPrimaryPartCFrame() * CFrame.new(0,-10,0))
end
end
while true do
if script.Parent.Parent.VonerableTime.Value == false then -- it just ignores this even when I manualy set it to true
for i = 0, 360 do
task.wait(speed)
-- note: cframe angle's x,y,z might need adjusted depending on model orientation.
monster:PivotTo(CFrame.new(center) * CFrame.Angles(0,math.rad(i),0) * CFrame.new(0,0,distanceFromCenter))
monster:PivotTo(monster:GetPivot() * CFrame.Angles(0,math.rad(-30),0))
end
elseif script.Parent.Parent.VonerableTime.Value == true then
MoveDown()-- once im done, I want him to move under the water.
end
end
I gave you that script, It’s the only script I gave. There is another script that changes the bool value and it works, it just doesn’t check if it changed for some reason under the script I gave.