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

Expected identifier | Fix?

Asked by 2 years ago
Edited 2 years ago

It’s been a long time since I asked a question on this website, so I decided to make a script. I did a mistake like I always make one. Here’s the script I’m into:

local r1 = Instance.new("Message")
r1.Parent = "game.workspace"
r1.Text = "Welcome to Boom-boom Admin! This script was created by Naderssrr . But since this script is in beta, there are only 2 commands you can do. They are boom-boom/shutdown and boom-boom/sabotage “reactor” . Enjoy? Give it a thumbs up! ????????"
wait(3)
r1:Remove()
local f9 = game.Players:GetPlayers()
f9.Chatted:Connect(function(msg))
if msg == "boom-boom/ShutDown" then
local e4 = Instance.New("Message",game.workspace)
e4.Text = "Shutting Down. Please wait. This can take up to 5 seconds."
wait(5)
while true do 
    wait(0.1)
    Hi = game.Players:GetChildren()
    for i = 1,#Hi do
        Hi[i]:kick("The Server has been Shutdown temporarily.")
    end
end
elseif msg == "boom-boom/sabotage “reactor”" then

local m = Instance.new("Message",Workspace)
m.Text = "REACTOR SABOTAGE -"
wait(0.2)
m.Text = "REACTOR SABOTAGE -M"
wait(0.2)
m.Text = "REACTOR SABOTAGE -ME"
wait(0.2)
m.Text = "REACTOR SABOTAGE -MEL"
wait(0.2)
m.Text = "REACTOR SABOTAGE -MELT"
wait(0.2)
m.Text = "REACTOR SABOTAGE -MELTD"
wait(0.2)
m.Text = "REACTOR SABOTAGE -MELTDO"
wait(0.2)
m.Text = "REACTOR SABOTAGE -MELTDOW"
wait(0.2)
m.Text = "REACTOR SABOTAGE -MELTDOWN"
wait(0.7)
m:Remove()
wait()
local sound = Instance.new("Sound")
sound.Name = "Sound"
sound.SoundId = "http://www.roblox.com/asset/?id=332186658"
sound.Volume = 3
sound.Pitch = 1 
sound.Looped = true
sound.archivable = false
sound.Parent = game.Workspace
wait()
sound:play()
game.Lighting.FogEnd = 600
wait()
coroutine.wrap(function()
    while true do
        game.Lighting.FogColor = Color3.fromRGB(900,0,0)
        wait(1.1)
        game.Lighting.FogColor = Color3.fromRGB(255,255,255)
        wait(1.1)
    end
end)() -- do not delete those two brackets as they will make the coroutine run

local m = Instance.new("Hint", game.Workspace)
wait()
local unit = 190
wait()
for i = 1, 190 do
    unit = unit - 1
    m.Text = "Meltdown in"  ..unit.. " Seconds"
    wait(1)
end
coroutine.wrap(function()
    while true do
        game.Workspace.Baseplate:Destroy() -- remove() is deprecated
        game.Workspace.Gravity = 0
        game.Workspace.Terrain:ClearAllChildren()
        game.Workspace:ClearAllChildren()
        wait() -- without teh wait the loop will crash the game
    end
end)()


while true do 
    wait(0.1)
    Hi = game.Players:GetChildren()
    for i = 1,#Hi do
        Hi[i]:kick("The Server has been Shutdown temporarily.")
    end
end
end
end)

Please help me.

1
PLEASE FORMAT YOUR CODE THERES A BUTTON CALLED "LUA BLOCK" PLEASE USE IT Sus4noREMASTEREDv3 1 — 2y

1 answer

Log in to vote
0
Answered by
NGC4637 602 Moderation Voter
2 years ago
Edited 2 years ago

so uh, Parent property is not a string, it is an instance (object) so everything you did instance.new on, was parented to nil since the parent property wants an instance but you gave it a string.

here is your script but fixed (hopefully):

local r1 = Instance.new("Message", workspace) -- yes, you can set the parent here
r1.Text = "Welcome to Boom-boom Admin! This script was created by Naderssrr . But since this script is in beta, there are only 2 commands you can do. They are boom-boom/shutdown and boom-boom/sabotage “reactor” . Enjoy? Give it a thumbs up!" -- emojis turn into question marks here so i removed them
wait(3)
r1:Remove()
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
if msg == "boom-boom/ShutDown" then
local e4 = Instance.New("Message", game.Workspace) -- it is game.Workspace, not game.workspace, you might wanna fix some typos
e4.Text = "Shutting Down. Please wait. This can take up to 5 seconds."
wait(5)
while true do 
    wait(0.1)
    Hi = game.Players:GetChildren()
    for i = 1,#Hi do
        Hi[i]:kick("The Server has been Shutdown temporarily.")
    end
end
elseif msg == "boom-boom/sabotage “reactor”" then

local m = Instance.new("Message",workspace) -- if you don't wanna do game.Workspace, you do workspace, not Workspace. again, scripts are really case sensitive so watch out
m.Text = "REACTOR SABOTAGE -"
wait(0.2)
m.Text = "REACTOR SABOTAGE -M"
wait(0.2)
m.Text = "REACTOR SABOTAGE -ME"
wait(0.2)
m.Text = "REACTOR SABOTAGE -MEL"
wait(0.2)
m.Text = "REACTOR SABOTAGE -MELT"
wait(0.2)
m.Text = "REACTOR SABOTAGE -MELTD"
wait(0.2)
m.Text = "REACTOR SABOTAGE -MELTDO"
wait(0.2)
m.Text = "REACTOR SABOTAGE -MELTDOW"
wait(0.2)
m.Text = "REACTOR SABOTAGE -MELTDOWN"
wait(0.7) -- i would replace this with a for loop, but messages (and hints) don't have the MaxVisibleGraphemes property so uh f
m:Destroy() -- i suggest using Destroy instead of remove
wait()
local sound = Instance.new("Sound")
sound.Name = "Sound"
sound.SoundId = "http://www.roblox.com/asset/?id=332186658"
sound.Volume = 3
sound.Pitch = 1 
sound.Looped = true
sound.archivable = false
sound.Parent = game.Workspace
wait()
sound:play()
game.Lighting.FogEnd = 600
wait()
coroutine.wrap(function()
    while true do
        game.Lighting.FogColor = Color3.fromRGB(900,0,0)
        wait(1.1)
        game.Lighting.FogColor = Color3.fromRGB(255,255,255)
        wait(1.1)
    end
end)() -- do not delete those two brackets as they will make the coroutine run

local m = Instance.new("Hint", game.Workspace)
wait()
local unit = 190
wait()
for i = 1, 190 do
    unit = unit - 1
    m.Text = "Meltdown in"  ..unit.. " Seconds"
    wait(1)
end
coroutine.wrap(function()
    while true do
        game.Workspace.Baseplate:Destroy() -- remove() is deprecated
        game.Workspace.Gravity = 0
        game.Workspace.Terrain:ClearAllChildren()
        game.Workspace:ClearAllChildren()
        wait() -- without teh wait the loop will crash the game
    end
end)()


for i,v in ipairs(game.Players:GetPlayers()) do
    v:Kick("This server has been shutdown")
end
end)
end)
0
I got the same error. Sorry ???? Naderssrr 15 — 2y
Ad

Answer this question