Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Unexpected error when script executed?

Hello. I was making a script, but then, it got an error. Here’s the script you should look into.

local assetId = 2176383273
local InsertService = game:GetService("InsertService")
local model = InsertService:LoadAsset(assetId)
model.Parent = game.Workspace
wait()
local Audio = Instance.new("Sound",game.Workspace)
Audio.SoundId = "rbxassetid://549313210"
Audio.Volume = 3
Audio.Name = "CoreAlarm"
Audio.Looped = True
Audio:Play()
wait()
local MSG1 = Instance.new("Message",game.Workspace)
MSG1.Text = "ALL REACTOR CORE SAFEGUARDS ARE NOW NONFUNCTIONAL! PLEASE PREPARE FOR REACTOR CORE MELTDOWN"
wait(6)
MSG1:remove()
wait()
local Audio = Instance.new("Sound",game.Workspace)
Audio.SoundId = "rbxassetid://1000895732"
Audio.Volume = 3
Audio.Name = "SelfDestructMessage"
Audio:Play()
wait(200)
local MSG2 = Instance.new("Message",game.Workspace)
MSG2.Text = "Reactor Meltdown in 4 minutes)
wait()
local Audio = Instance.new("Sound",game.Workspace)
Audio.SoundId = "rbxassetid://1000912359"
Audio.Volume = 3
Audio.Name = "SelfDestructMessageB"
Audio:Play()
wait(5)
MSG2:remove()
wait()
local Audio = Instance.new("Sound",game.Workspace)
Audio.SoundId = "rbxassetid://466949705"
Audio.Volume = 3
Audio.Name = "CoreCorruptionMusic"
Audio:Play()
wait(200)
local Audio = Instance.new("Sound",game.Workspace)
Audio.SoundId = "rbxassetid://1002834205"
Audio.Volume = 3
Audio.Name = "SelfDestructMessageC"
Audio:Play()
wait(5)
local MSG3 = Instance.new("Message",game.Workspace)
MSG3.Text = "Self destruct in 2 minutes! Please evacuate now."
wait(5)
MSG3:remove()
wait()
local m = Instance.new("Hint", game.Workspace)
wait()
local unit = 190
wait()
for i = 1,200 do
    unit = unit - 1
    m.Text = "Prepare to meet your demise. T-"  ..unit.. " Seconds till the universe is destroyed."
    wait(1)
end
local Hint = Instance.new("Hint",game.Workspace)
Hint.Text = "CAUTION! CORE WILL EXPLODE NOW!"
wait(3)
for i = 1,5 do
    unit = unit - 1
    Hint.Text = "YOU HAVE T-"  ..unit.. " SECONDS TILL THE CORE EXPLODE!"
    wait(1)
end
Hint:Remove()
wait()
local assetId = 11277172
local InsertService = game:GetService("InsertService")
local model = InsertService:LoadAsset(assetId)
model.Parent = game.Workspace
model.Name = "NUKE"
wait(1)
local m = Instance.new("Message",game.Workspace)
for i = 1,60 do
    unit = unit - 1
    m.Text = "Server shutting down in"  ..unit.. " Seconds."
    wait(1)
end
game.Players:ClearAllChildren()

I really hate when I get errors and don’t know how to fix them, so I am counting on you guys.

Regarding, Naderssrr

5 comments

0

I’m sorry if this is a very long script.

0

Please indent your code, and also include the error.

0

It got a malformed string,

0

Please copy and paste the error.

0

This code is highly inefficient.

1 answer

✓ Accepted answer

On line 25, you forgot to fully encapsulate the String with quotations. This is something you should've determined on your own; ScriptAnalysis is very likely to have caught this mistake and underlined it too. Not only would the line number be included, but the error would also be obvious as the syntax highlighting would be completely foreign to the rest of the existing Strings.

MSG2.Text = "Reactor Meltdown in 4 minutes"

####Please organize your programs better, and pay more attention.

3 comments

0

I will see if it works.

0

Omg it worked, thanks!

0

My god. This post is OLD

This discussion is preserved as it was. New answers, comments, and votes are closed.