Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

This script keeps not working, can anyone tell me what is wrong with it? [UNSOLVED]

Asked by 10 years ago

Basically this is a launch script that will work based on the new nerfed explosions and physics engine. I keep having issues pop up with Lines 64, 65, and 77. Can anyone read through this and help me correct it? (I am fairly new to RBX.Lua and scripting in Roblox as a whole so I apologize if I come off as "stupid").

What it is showing in the dev console and the output is at the very bottom, also, if you find any other errors, please let me know.

The issue now is it lags out the server and studio to a crash after the script has gotten to Lines 40-42. (I am unsure if it gets to Line 42 because nothing happens after it displays "Ignition" in the Dev Console and as a hint)

--Also how would I remove the hints after they have been displayed? (currently they are just layering over each other.)

print("Script Active. Waiting Launch.")
local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Ready for Launch."
Main = game.Workspace.Rocket.RocketModel.Head
Top = game.Workspace.Rocket.RocketModel.Head2
Booster = game.Workspace.Rocket.RocketModel.Booster
GantrySide = game.Workspace.Gantry.gantrymiddle.Side
Middle = game.Workspace.Rocket.RocketModel.Middle

game.Workspace.Rocket.Explosiontrigger.ClickDetector.MouseClick:connect(function (onClicked)
 local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 10"
    print("Omicron I Launching in 10")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 9"
    print("Omicron I Launching in 9")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 8"
    print("Omicron I Launching in 8")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 7"
    print("Omicron I Launching in 7")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 6"
    print("Omicron I Launching in 6")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 5"
    print("Omicron I Launching in 5")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 4"
    print("Omicron I Launching in 4")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 3"
    print("Omicron I Launching in 3")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 2"
    print("Omicron I Launching in 2")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 1"
    print("Omicron I Launching in 1")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Ignition"
    print("Ignition")
    wait(1)
    explosion = Instance.new("Explosion")
    explosion.BlastRadius = 50
    explosion.BlastPressure = 1000
    explosion.DestroyJointRadiusPercent = 0
    explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
    explosion.Parent = game.Workspace.Rocket.RocketModel.Booster
    wait(1)
    explosion = Instance.new("Explosion")
    explosion.BlastRadius = 50
    explosion.BlastPressure = 1000
    explosion.DestroyJointRadiusPercent = 0
    explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
    explosion.Parent = game.Workspace.Rocket.RocketModel.Booster
if
    Main.Velocity.y > 100
    then
    local h = Instance.new("Hint",Workspace) h.Text = "Liftoff."
    print("Liftoff")
    wait(2)
    explosion = Instance.new("Explosion")
    explosion.BlastRadius = 50
    explosion.BlastPressure = 750
    explosion.DestroyJointRadiusPercent = 0
    explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
    explosion.Parent = game.Workspace.Rocket.RocketModel.Booster
else
    explosion = Instance.new("Explosion")
    explosion.BlastRadius = 50
    explosion.BlastPressure = 2500
    explosion.DestroyJointRadiusPercent = 0
    explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
    explosion.Parent = game.Workspace.Rocket.RocketModel.Booster
repeat
    explosion = Instance.new("Explosion")
    explosion.BlastRadius = 50
    explosion.BlastPressure = 3000
    explosion.DestroyJointRadiusPercent = 0
    explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
    explosion.Parent = game.Workspace.Rocket.RocketModel.Booster
until Main.Velocity.y > 21000
    wait(2)
    if Main.Velocity.y > 20000
    then
    wait(5)
    if Main.Velocity.y > 19500
        then
        wait(5)
        explosion = Instance.new("Explosion")
        explosion.BlastRadius = 50
        explosion.BlastPressure = 2500
        explosion.DestroyJointRadiusPercent = 0
        explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
        explosion.Parent = game.Workspace.Rocket.RocketModel.Booster
    else
        explosion = Instance.new("Explosion")
        explosion.BlastRadius = 50
        explosion.BlastPressure = 4750
        explosion.DestroyJointRadiusPercent = 0
        explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
        explosion.Parent = game.Workspace.Rocket.RocketModel.Booster
        if Main.Velocity.y < 1
            then
            local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launch Failed."
            print("Omicron I Launch Failed.")
            wait(2)
            local h = Instance.new("Hint",Workspace) h.Text = "Please contact Launch Administrators."
            print("Please contact Launch Administrators")
            wait(2)local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launch Failed."
            print("Omicron I Launch Failed.")
            wait(2)
            local h = Instance.new("Hint",Workspace) h.Text = "Please contact Launch Administrators."
            print("Please contact Launch Administrators")
            wait(2)local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launch Failed."
            print("Omicron I Launch Failed.")
            wait(2)
            local h = Instance.new("Hint",Workspace) h.Text = "Please contact Launch Administrators."
            print("Please contact Launch Administrators")
            wait(2)local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launch Failed."
            print("Omicron I Launch Failed.")
            wait(2)
            local h = Instance.new("Hint",Workspace) h.Text = "Please contact Launch Administrators."
            print("Please contact Launch Administrators")
            wait(2)
            local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launch Failed."
            print("Omicron I Launch Failed.")
            wait(2)
            local h = Instance.new("Hint",Workspace) h.Text = "Please contact Launch Administrators."
            print("Please contact Launch Administrators")
            wait(2)         
                print("Catastrophic Failure Imminent. Please Clear the Area.")
                local h = Instance.new("Hint",Workspace) h.Text ="Catastrophic Failure Imminent. Please Clear the Area."
                wait(2)
                print("Systems Failed. Catastrophic Failure Imminent. Please Clear the Area.")
                local h = Instance.new("Hint",Workspace) h.Text ="Systems Failed. Catastrophic Failure Imminent. Please Clear the Area."
                wait(2)
                print("Cooling Systems Failure. Danger Level - Extremely High")
                local h = Instance.new("Hint",Workspace) h.Text = "Cooling Systems Failure. Danger Level - Extremely High"
                wait(2)
                print("Cooling Systems Reboot...")
                local h = Instance.new("Hint",Workspace) h.Text = "Cooling Systems Reboot..."
                explosion = Instance.new("Explosion")
                    explosion.BlastRadius = 50
                    explosion.BlastPressure = 100000
                    explosion.DestroyJointRadius = 95
                    explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
                    explosion.Parent = game.Workspace.Rocket.RocketModel.Booster
                    wait(1)
                    print("Reboot Failed. Catastrophic Failure Imminent. Please Clear the Area.")
                    local h = Instance.new("Hint",Workspace) h.Text = "Reboot Failed. Catastrophic Failure Imminent. Please Clear the Area."
                    wait(2)
                    explosion = Instance.new("Explosion")
                    explosion.BlastRadius = 25
                    explosion.BlastPressure = 5000
                    explosion.DestroyJointRadius = 95
                    explosion.Position = game.Workspace.Gantry.Gantrymiddle.Side.Position
                    explosion.Parent = game.Workspace.Gantry.gantrymiddle.Side
                    wait(3)
                    print("Operational Systems Failed. Shutting Down...")
                    local h = Instance.new("Hint",Workspace) h.Text = "Operational Systems Failed. Shutting Down..."
                    wait(2)
                    explosion = Instance.new("Explosion")
                    explosion.BlastRadius = 125
                    explosion.BlastPressure = 500000
                    explosion.DestroyJointRadius = 95
                    explosion.Position = game.Workspace.Rocket.RocketModel.Middle.Position
                    explosion.Parent = game.Workspace.Rocket.RocketModel.Middle
                    wait(1)
                    explosion = Instance.new("Explosion")
                    explosion.BlastRadius = 185
                    explosion.BlastPressure = 7500
                    explosion.DestroyJointRadius = 95
                    explosion.Position = game.Workspace.Rocket.RocketModel.Top.Position
                    explosion.Parent = game.Workspace.Rocket.RocketModel.Head2
                    wait(5)
                end
            end
        end
end
end)

4 answers

Log in to vote
1
Answered by
Sublimus 992 Moderation Voter
10 years ago

On line 77 you have:

explosion.Position = game.Workspace.Rocket.RocketModel.Booster

A position has to be set to a Vector3 value, you are trying to set it to an object. It should be:

explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
0
Okay, now it is saying: 23:01:36 -- Workspace.Rocket.Explosion trigger.Script:182: '<eof>' exoected near 'end' -I have updated the script shown above to what it is currently in-game as well. areiydenfan00 115 — 10y
0
You have an extra end Sublimus 992 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

Also, for the countdown you can use a for loop.

for i = 10,1,-1 do
print("Omicron I lauching in"..i)
wait(1)
Log in to vote
0
Answered by
IcyEvil 260 Moderation Voter
10 years ago

Here is what I scrapped Up from all of this.

print("Script Active. Waiting Launch.")
local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Ready for Launch."
Main = game.Workspace.Rocket.RocketModel.Head
Top = game.Workspace.Rocket.RocketModel.Head2
Booster = game.Workspace.Rocket.RocketModel.Booster
GantrySide = game.Workspace.Gantry.gantrymiddle.Side
Middle = game.Workspace.Rocket.RocketModel.Middle

game.Workspace.Name.ClickDetector.MouseClick:connect(function (onClicked) 
 local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 10"
    print("Omicron I Launching in 10")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 9"
    print("Omicron I Launching in 9")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 8"
    print("Omicron I Launching in 8")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 7"
    print("Omicron I Launching in 7")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 6"
    print("Omicron I Launching in 6")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 5"
    print("Omicron I Launching in 5")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 4"
    print("Omicron I Launching in 4")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 3"
    print("Omicron I Launching in 3")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 2"
    print("Omicron I Launching in 2")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launching in 1"
    print("Omicron I Launching in 1")
    wait(1)
    local h = Instance.new("Hint",Workspace) h.Text = "Ignition"
    print("Ignition")
    wait(1)
    explosion = Instance.new("Explosion")
    explosion.BlastRadius = 50
    explosion.BlastPressure = 1000
    explosion.DestroyJointRadiusPercent = 0
    explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
    explosion.Parent = game.Workspace.Rocket.RocketModel.Booster
    wait(1)
    explosion = Instance.new("Explosion")
    explosion.BlastRadius = 50
    explosion.BlastPressure = 1000
    explosion.DestroyJointRadiusPercent = 0
    explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
    explosion.Parent = game.Workspace.Rocket.RocketModel.Booster
if
    Main.Velocity.y > 100
    then
    local h = Instance.new("Hint",Workspace) h.Text = "Liftoff."
    print("Liftoff")
    wait(2)
    explosion = Instance.new("Explosion")
    explosion.BlastRadius = 50
    explosion.BlastPressure = 750
    explosion.DestroyJointRadiusPercent = 0
    explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
    explosion.Parent = game.Workspace.Rocket.RocketModel.Booster
else
    explosion = Instance.new("Explosion")
    explosion.BlastRadius = 50
    explosion.BlastPressure = 2500
    explosion.DestroyJointRadiusPercent = 0
    explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
    explosion.Parent = game.Workspace.Rocket.RocketModel.Booster
repeat
    explosion = Instance.new("Explosion")
    explosion.BlastRadius = 50
    explosion.BlastPressure = 3000
    explosion.DestroyJointRadiusPercent = 0
    explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
    explosion.Parent = game.Workspace.Rocket.RocketModel.Booster
until Main.Velocity.y > 21000
    wait(2)
    if Main.Velocity.y > 20000
    then
    wait(5)
    if Main.Velocity.y > 19500
        then
        wait(5)
        explosion = Instance.new("Explosion")
        explosion.BlastRadius = 50
        explosion.BlastPressure = 2500
        explosion.DestroyJointRadiusPercent = 0
        explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
        explosion.Parent = game.Workspace.Rocket.RocketModel.Booster
    else
        explosion = Instance.new("Explosion")
        explosion.BlastRadius = 50
        explosion.BlastPressure = 4750
        explosion.DestroyJointRadiusPercent = 0
        explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
        explosion.Parent = game.Workspace.Rocket.RocketModel.Booster
        if Main.Velocity.y < 1
            then
            local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launch Failed."
            print("Omicron I Launch Failed.")
            wait(2)
            local h = Instance.new("Hint",Workspace) h.Text = "Please contact Launch Administrators."
            print("Please contact Launch Administrators")
            wait(2)local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launch Failed."
            print("Omicron I Launch Failed.")
            wait(2)
            local h = Instance.new("Hint",Workspace) h.Text = "Please contact Launch Administrators."
            print("Please contact Launch Administrators")
            wait(2)local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launch Failed."
            print("Omicron I Launch Failed.")
            wait(2)
            local h = Instance.new("Hint",Workspace) h.Text = "Please contact Launch Administrators."
            print("Please contact Launch Administrators")
            wait(2)local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launch Failed."
            print("Omicron I Launch Failed.")
            wait(2)
            local h = Instance.new("Hint",Workspace) h.Text = "Please contact Launch Administrators."
            print("Please contact Launch Administrators")
            wait(2)
            local h = Instance.new("Hint",Workspace) h.Text = "Omicron I Launch Failed."
            print("Omicron I Launch Failed.")
            wait(2)
            local h = Instance.new("Hint",Workspace) h.Text = "Please contact Launch Administrators."
            print("Please contact Launch Administrators")
            wait(2)         
                print("Catastrophic Failure Imminent. Please Clear the Area.")
                local h = Instance.new("Hint",Workspace) h.Text ="Catastrophic Failure Imminent. Please Clear the Area."
                wait(2)
                print("Systems Failed. Catastrophic Failure Imminent. Please Clear the Area.")
                local h = Instance.new("Hint",Workspace) h.Text ="Systems Failed. Catastrophic Failure Imminent. Please Clear the Area."
                wait(2)
                print("Cooling Systems Failure. Danger Level - Extremely High")
                local h = Instance.new("Hint",Workspace) h.Text = "Cooling Systems Failure. Danger Level - Extremely High"
                wait(2)
                print("Cooling Systems Reboot...")
                local h = Instance.new("Hint",Workspace) h.Text = "Cooling Systems Reboot..."
                explosion = Instance.new("Explosion")
                    explosion.BlastRadius = 50
                    explosion.BlastPressure = 100000
                    explosion.DestroyJointRadius = 95
                    explosion.Position = game.Workspace.Rocket.RocketModel.Booster.Position
                    explosion.Parent = game.Workspace.Rocket.RocketModel.Booster
                    wait(1)
                    print("Reboot Failed. Catastrophic Failure Imminent. Please Clear the Area.")
                    local h = Instance.new("Hint",Workspace) h.Text = "Reboot Failed. Catastrophic Failure Imminent. Please Clear the Area."
                    wait(2)
                    explosion = Instance.new("Explosion")
                    explosion.BlastRadius = 25
                    explosion.BlastPressure = 5000
                    explosion.DestroyJointRadius = 95
                    explosion.Position = game.Workspace.Gantry.Gantrymiddle.Side.Position
                    explosion.Parent = game.Workspace.Gantry.gantrymiddle.Side
                    wait(3)
                    print("Operational Systems Failed. Shutting Down...")
                    local h = Instance.new("Hint",Workspace) h.Text = "Operational Systems Failed. Shutting Down..."
                    wait(2)
                    explosion = Instance.new("Explosion")
                    explosion.BlastRadius = 125
                    explosion.BlastPressure = 500000
                    explosion.DestroyJointRadius = 95
                    explosion.Position = game.Workspace.Rocket.RocketModel.Middle.Position
                    explosion.Parent = game.Workspace.Rocket.RocketModel.Middle
                    wait(1)
                    explosion = Instance.new("Explosion")
                    explosion.BlastRadius = 185
                    explosion.BlastPressure = 7500
                    explosion.DestroyJointRadius = 95
                    explosion.Position = game.Workspace.Rocket.RocketModel.Top.Position
                    explosion.Parent = game.Workspace.Rocket.RocketModel.Head2
                    wait(5)
                end
            end
        end
end
end)
0
Had to change line 9 to: "game.Workspace.Rocket.Explosiontrigger.ClickDetector.MouseClick:connect(function (onClicked)" (clearly without the " 's) and now it just lags out the server and studio to a crash after it reaches about line 40 or(Console prints out Ignition as well as the Hint gets displayed.) areiydenfan00 115 — 10y
Log in to vote
0
Answered by
EFPA223 10
10 years ago

Wow, massive script dude. O.o Probably pushing near the 10k character limit here. Is it possible to simplify your script to just a loop of explosions in the part you have mapped at game.Workspace.Rocket.RocketModel.Booster?

0
Thanks, I guess? And I had to get rid of a few lines at the bottom because I went over the char limit. And it probably is, I just don't know how to.... areiydenfan00 115 — 10y
0
Lol, I'm not very good with loops so I'm sorry that I can't help you here. Feel free to message me if you have any other issues though! EFPA223 10 — 10y
0
Thanks for the idea! areiydenfan00 115 — 10y

Answer this question