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: Help.

Previous Thread :: Next Thread 
drc3 is not online. drc3
Joined: 14 Aug 2009
Total Posts: 1284
14 Oct 2014 01:15 PM
So, I have this disaster game. The script works great, but I want the floor at the beginning of each round where the player spawned to have its cancollide turned off for a few seconds and then back on.

Basically, I want to make it so the players fall into the disaster game/lobby from the place where they spawned.

Can someone help me add this function to this script?

disasters = {"Jimmy Neutron's Acid Rain", "Ninja Turtle Mutation", "Plankton's Abduction Ship", "Spongebob Attack of the Slimes", "Courage the Dog", "Sharingan", "Timmy's Shooting Star Gone Wrong", "Zombie Spongebob", "Slenderman Spongebob"} -- This is where you list the names models that you want to use for disasters.


countdownTime = 15
disasterTime = 30

countdownMessage = "The next disaster will occur in %s seconds."
disasterMessage = "Survive: %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 = 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
leaderboard.running.Value = false
end
end
Report Abuse
Daftcube is not online. Daftcube
Joined: 10 Jan 2010
Total Posts: 275
14 Oct 2014 02:33 PM
So... Whats the error?
Report Abuse
Daftcube is not online. Daftcube
Joined: 10 Jan 2010
Total Posts: 275
14 Oct 2014 02:35 PM
@Above nvm. I see what you want. It should be easy, just get a table of players, then get the players' characters, then do a loop through the character table and set all children that are parts to CanCollide = False...

That actually sounds really complicated but it isn't.
Report Abuse
drc3 is not online. drc3
Joined: 14 Aug 2009
Total Posts: 1284
14 Oct 2014 11:39 PM
Think you could implement it?
Report Abuse
drc3 is not online. drc3
Joined: 14 Aug 2009
Total Posts: 1284
15 Oct 2014 04:15 PM
Bump.
Report Abuse
Mkhero4433 is not online. Mkhero4433
Joined: 28 Aug 2010
Total Posts: 227
15 Oct 2014 04:17 PM
Can you give us the output some we can know where to look?
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