generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Survive the disasters countdown error

Previous Thread :: Next Thread 
Vinny0TheMinecrafter is not online. Vinny0TheMinecrafter
Joined: 12 May 2014
Total Posts: 54
03 Jul 2014 01:04 PM
please help me here with the thing (ok back to what I was going to say) ever since I added a new disaster the countdown message wont work so please help me guys and heres the script (output at the bottom)


Script :



disasters = {"Bombs","Zombie","Giant Ninja Stars","Bowling Balls","Avoid Being Trapped","Dont Push The Button","Falling Metor","Falling Robux","Falling Sun","Falling Tix","Falling Eyeballs","Noob","Random Nukes","Shooting Eyes","Zombie","(Bonus round!) Touch one of the potatos or you fail!","Davy Jones","Jockey attack","Raising Lava","Scream","Zombie","Zombie Apocalypse!","a small army of evil robots","beiber zombies","black holes of doom","epic ducks of doom","epic jasons (RUN)","five tanks","epic turrets","four meteors of death","freddy kruger clones","noises grave","two giant noobs","zombie army","Ghasts (Minecraft)","Guests","Meteors","Noobs","Slimes (Big) (Minecraft)","Zombie Pig Men (Minecraft)","Zombies (Minecraft)"} -- This is where you list the names models that you want to use for disasters.
-- Disaster names are case-sensitive and all disaster models must be in the lighting

countdownTime = 15 -- The ammount of time to wait between each disaster.
disasterTime = 25 -- The ammount of time that the disaster will be in the game before it is removed.
d
countdownMessage = "The next disaster will occur in %s seconds." -- The message displayed between disasters. %s will be replaced with the number of seconds left.
disasterMessage = "Disaster: %s" -- The message displayed when a disaster occurs. %s will be replaced with the disaster name. Set to nil if you do not want a message

-- Unless you know what you are doing, please leave the below code alone.
items = {}
leaderboard = game.Workspace:findFirstChild("BTS Leaderboard") -- Used to work with my BTS leaderboard
local w = game.Workspace:getChildren()
for i=1,#w do
if w[i].Name == "leaderboard" and w[i]:findFirstChild("running") ~= nil and w[i]:findFirstChild("points") ~= ni then
leaderboard = w[i]
end
end
for i=1,#disasters do
local item = game.Lighting:findFirstChild(disasters[i])
if item ~= nil then
item.Parent = nil
table.insert(items, item)
else
print("Error! ", disasters[i], " was not found!")
end
end

function chooseDisaster()
return items[math.random(#items)]
end

function sethint(text)
local hint = game.Workspace:findFirstChild("hint")
if (hint ~= nil) then
hint.Text = text
else
print("Hint does not exist, creating...")
h = Instance.new("Hint")
h.Name = "hint"
h.Text = text
h.Parent = game.Workspace
end
--print("Hint set to: ", text)
end

function removeHint()
hint = game.Workspace:findFirstChild("hint")
if (hint ~= nil) then hint:remove() end
end

function countdown(time)
sethint(string.format(countdownMessage, tostring(time)))
while (time > 0) do
wait(1)
time = time - 1
sethint(string.format(countdownMessage, tostring(time)))
end
removeHint()
return true
end

while true do
countdown(countdownTime)

if leaderboard ~= nil and leaderboard:findFirstChild("running") and leaderboard:findFirstChild("points") then -- For use with my BTS leaderboard.
leaderboard.points.Value = 30
leaderboard.running.Value = true
end

local m = chooseDisaster():clone()

if disasterMessage ~= nil then
local msg = Instance.new("Message")
msg.Name = "DisasterMsg"
msg.Text = string.format(disasterMessage, m.Name)
msg.Parent = game.Workspace
wait(3)
msg.Parent = nil
end

m.Parent = game.Workspace
m:makeJoints()
wait(disasterTime)
m:remove()

if leaderboard ~= nil then -- For use with the bts leaderboard.
leaderboard.running.Value = false
end
end





Output : Leaderboard Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
13:46:21.314 - Workspace.Disaster Script:9: '=' expected near 'countdownMessage'
Shop Script Loaded
Report Abuse
Vinny0TheMinecrafter is not online. Vinny0TheMinecrafter
Joined: 12 May 2014
Total Posts: 54
03 Jul 2014 01:32 PM
hello anyone only 10 views and no replies
Report Abuse
usfirepilot is not online. usfirepilot
Joined: 17 Jan 2013
Total Posts: 684
03 Jul 2014 01:36 PM
Listen. We are not fixing a model. I have this EXACT script in my game and it works fine.
Here *Rolls Eyes*
P.S. Re-Add your disasters

disasters = {"Valcano", "Falling Lava", "Tornado", "Black Hole", "Noobs!"}

countdownTime = 60
disasterTime = 45

countdownMessage = "Next disaster in %s seconds!"
disasterMessage = "Disaster: %s"

items = {}
leaderboard = game.Workspace:findFirstChild("BTS Leaderboard")
local w = game.Workspace:getChildren()
for i=1,#w do
if w[i].Name == "leaderboard" and w[i]:findFirstChild("running") ~= nil and w[i]:findFirstChild("points") ~= ni then
leaderboard = w[i]
end
end
for i=1,#disasters do
local item = game.Lighting:findFirstChild(disasters[i])
if item ~= nil then
item.Parent = nil
table.insert(items, item)
else
print("Error! ", disasters[i], " was not found!")
end
end

function chooseDisaster()
return items[math.random(#items)]
end

function sethint(text)
local hint = game.Workspace:findFirstChild("hint")
if (hint ~= nil) then
hint.Text = text
else
print("Hint does not exist, creating...")
h = Instance.new("Hint")
h.Name = "hint"
h.Text = text
h.Parent = game.Workspace
end
--print("Hint set to: ", text)
end

function removeHint()
hint = game.Workspace:findFirstChild("hint")
if (hint ~= nil) then hint:remove() end
end

function countdown(time)
sethint(string.format(countdownMessage, tostring(time)))
while (time > 0) do
wait(1)
time = time - 1
sethint(string.format(countdownMessage, tostring(time)))
end
removeHint()
return true
end

while true do
countdown(countdownTime)

if leaderboard ~= nil and leaderboard:findFirstChild("running") and leaderboard:findFirstChild("points") then
leaderboard.points.Value = 10
leaderboard.running.Value = true
end

local m = chooseDisaster():clone()

if disasterMessage ~= nil then
local msg = Instance.new("Message")
msg.Name = "DisasterMsg"
msg.Text = string.format(disasterMessage, m.Name)
msg.Parent = game.Workspace
wait(3)
msg.Parent = nil
end

m.Parent = game.Workspace
m:makeJoints()
wait(disasterTime)
m:remove()

if leaderboard ~= nil then
leaderboard.running.Value = false
end
end


-Its just roblox... Deal with it-
Report Abuse
Vinny0TheMinecrafter is not online. Vinny0TheMinecrafter
Joined: 12 May 2014
Total Posts: 54
03 Jul 2014 05:01 PM
well thanks kind of
Report Abuse
Vinny0TheMinecrafter is not online. Vinny0TheMinecrafter
Joined: 12 May 2014
Total Posts: 54
04 Jul 2014 01:00 PM
Ok everyone shoop da woop was messing up my thing but the last error that changed is this output

Output : 13:56:32.217 - Workspace.READ ME:79: unexpected symbol near '='
Leaderboard Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded
Shop Script Loaded



FOCOUS ON THIS : 13:56:32.217 - Workspace.READ ME:79: unexpected symbol near '='

I went to number 79 and saw this : msg.Parent = game.Workspace

there doesn't seem to be anything near it that is messing it up tell me if this is working or its just good old ROBLOX striking again
Report Abuse
Vinny0TheMinecrafter is not online. Vinny0TheMinecrafter
Joined: 12 May 2014
Total Posts: 54
04 Jul 2014 01:36 PM
come on guys 40 VEIWS and no good replies please I need a reply
Report Abuse
VirtualPrince is not online. VirtualPrince
Joined: 17 Oct 2013
Total Posts: 7386
04 Jul 2014 01:57 PM
That disaster script is so not efficient it hurts to look at it

1. Why are you listing all the disasters in the table when you could just get the children

2. How could you write all this without knowing what the simple problem is?
Report Abuse
Vinny0TheMinecrafter is not online. Vinny0TheMinecrafter
Joined: 12 May 2014
Total Posts: 54
04 Jul 2014 02:19 PM
oh come on why cant you at least tell me
Report Abuse
Vinny0TheMinecrafter is not online. Vinny0TheMinecrafter
Joined: 12 May 2014
Total Posts: 54
04 Jul 2014 04:42 PM
NEVERMIND THERE WAS A B MESSING EVERYTHING UP ALL GOOD WORKING WELL THANKS FOR YOUR HELP ANYWAY
Report Abuse
nobbers12345 is not online. nobbers12345
Joined: 06 Feb 2011
Total Posts: 4425
04 Jul 2014 04:48 PM
Don't act like WE didn't give you anything because we didn't want to.
YOU didn't give us anything to work with quickly. You just posted an entire model and said fix it.

I hate the LGBT. Those laser guided battle tanks are just too damn powerful.
Report Abuse
Vinny0TheMinecrafter is not online. Vinny0TheMinecrafter
Joined: 12 May 2014
Total Posts: 54
12 Aug 2014 07:24 AM
dude roblox scripting is new to me now i'm completely good at it i really don't need the help
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image