Elseif Statement not working

Hi

I am sure that what I have done here is obvious to many people, however I can’t seem to spot it:
In the section of code shown below, the code jumps straight to the first elseif and does that condition, even though it doesn’t actually match any of those conditions, it should be matching the first one

while true do
	wait (1)
	if workspace.CoreSystem.CoreStatus == "OFFLINE" then
		script.Parent.Text = "Facility is currently using     Main Generator Power"
	elseif workspace.CoreSystem.CoreStatus == "Stable" or "Too Cold" or "Overheating" or "Critical" then
		wait (2)
		script.Parent.Text = "Facility is currently using     Reactor Core Power"
	elseif workspace.CoreSystem.CoreStatus == "Startup" or "Igniting" or "Unstable" then
		script.Parent.Text = "Facility is currently switching power."
	elseif workspace.CoreSystem.CoreStatus == "Near Meltdown" or "Meltdown" or "Override Expired" or "Polarized" or "Freezedown" or "Shutdown Failed" then
		script.Parent.Text = "Facility is currently using     ????? Power"
	elseif workspace.CoreSystem.CoreStatus == "Shutdown" then
		script.Parent.Text = "Facility currently has no power."
	else
		script.Parent.Text = "Facility is currently using     ????? Power"
	end
end

If anyone has any ideas or needs more info do ask.
Thanks

try replace every “Elseif” into “if” also add more “End” underneath

I tried this and it does the same thing.

while true do
	wait (1)
	if workspace.CoreSystem.CoreStatus == "OFFLINE" then
		script.Parent.Text = "Facility is currently using     Main Generator Power"
	else
		if workspace.CoreSystem.CoreStatus == "Stable" or "Too Cold" or "Overheating" or "Critical" then
			wait (2)
			script.Parent.Text = "Facility is currently using     Reactor Core Power"
		else
			if workspace.CoreSystem.CoreStatus == "Startup" or "Igniting" or "Unstable" then
				script.Parent.Text = "Facility is currently switching power."
			else	
				if workspace.CoreSystem.CoreStatus == "Near Meltdown" or "Meltdown" or "Override Expired" or "Polarized" or "Freezedown" or "Shutdown Failed" then
					script.Parent.Text = "Facility is currently using     ????? Power"
				else				
				if workspace.CoreSystem.CoreStatus == "Shutdown" then
					script.Parent.Text = "Facility currently has no power."
					else
						script.Parent.Text = "Facility is currently using     ????? Power"
					end
				end
			end
		end
	end
end

Is “CoreStatus” a StringValue instance? You need to index its “Value” property to get its value if so.

workspace.CoreSystem.CoreStatus.Value

I didn’t meant like that
This is was what i wanted

while true do
	wait (1)
	if workspace.CoreSystem.CoreStatus == "OFFLINE" then
		script.Parent.Text = "Facility is currently using     Main Generator Power"
		if workspace.CoreSystem.CoreStatus == "Stable" or "Too Cold" or "Overheating" or "Critical" then
			wait (2)
			script.Parent.Text = "Facility is currently using     Reactor Core Power"
			if workspace.CoreSystem.CoreStatus == "Startup" or "Igniting" or "Unstable" then
				script.Parent.Text = "Facility is currently switching power."
				if workspace.CoreSystem.CoreStatus == "Near Meltdown" or "Meltdown" or "Override Expired" or "Polarized" or "Freezedown" or "Shutdown Failed" then
					script.Parent.Text = "Facility is currently using     ????? Power"			
				if workspace.CoreSystem.CoreStatus == "Shutdown" then
					script.Parent.Text = "Facility currently has no power."
						script.Parent.Text = "Facility is currently using     ????? Power"
					end
				end
			end
		end
	end
end

What is workspace.CoreSystem.CoreStatus? If it’s a value of any kind you’ll need to put workspace.CoreSystem.CoreStatus.Value instead.

1 Like

Thank you for the answer.

I can’t believe I didn’t see this. I’ve done this multiple times before aswell.