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: Survivor finding script

Previous Thread :: Next Thread 
skipperguy12 is not online. skipperguy12
Joined: 09 Oct 2009
Total Posts: 955
01 Dec 2011 06:10 PM
Please help. I think the error is at around line 41 through 65...

NO OUTPUT ERROR

Workspace = Game:GetService("Workspace")
Players = Game:GetService("Players")


msg = Instance.new("Message",Lighting)

playas = Players:GetPlayers()

MapParents = Game:GetService("Lighting")
-- I'm assuming you parent your maps to Lighting... Change it if it isn't.

-- tables =3
Maps = {}
survivers = {}
dead = {}
-- /tables =3
CurrentMap = nil

for _, Map in pairs(MapParents:GetChildren()) do
table.insert(Maps, Map)
end

UpdateMap = function()
if type(CurrentMap) == "userdata" then
CurrentMap.Parent = MapParents
CurrentMap = nil
end

msg.Parent = game.Workspace
msg.Text = "Chosing a random map"

local NewMap = Maps[ math.random(1, #Maps) ]
NewMap.Parent = Workspace

CurrentMap = NewMap
msg.Text = "Map Chosen: "..NewMap.Name.."!"
wait(4)
msg.Parent = game.Lighting
end

-- Printing survivors function, else, print "No survivors"...
GetSurvivors = function()
local String = ""
if #survivers == 0 then
msg.Parent = game.Workspace
--return "No survivors"
msg.Parent = game.Workspace
msg.Text = "No survivors"
wait(4)
msg.Parent = game.Lighting
end

for i, name in pairs(survivers) do
--String = String .. "name" .. ", "
String = ""..name..", "
end
String = String:sub(1, string.len(String) -1)
--return String
msg.Parent = game.Workspace
msg.Text = ""..String..""
wait(4)
msg.Parent = game.Lighting

end
-- /Printing survivors function, else, print "No survivors"...

while not false do
msg.Parent = Workspace
msg.Text = "Take a break, 15 seconds before next round!"
wait(2)
msg.Parent = MapParent

playas = Players:GetPlayers() -- Updates it, incase new people join or people leave

for i = 1,#playas do
playas[i].Character:MoveTo(Workspace.TeleSpawn.Position + (Vector3.new(5,0,0) * i))
end

for i = 15, 0, -1 do --Start, finish, increment
wait(1)
for k, v in pairs(game.Players:GetChildren()) do
v.PlayerGui.CountdownGui.Frame.TextButton.Text = i
end
end

--wait(15)

msg.Parent = game.Workspace
msg.Text = "Its game time!"
wait(2)
msg.Parent = game.Lighting

UpdateMap()

for i = 1,#playas do
--playas[i].Character:MoveTo(CurrentMap.GameSpawn.Position + (Vector3.new(5,0,0) * i))
playas[i].Character.Humanoid.Health = 0
end



for i = 15, 0, -1 do --Start, finish, increment
wait(1)
for k, v in pairs(game.Players:GetChildren()) do
v.PlayerGui.CountdownGui.Frame.TextButton.Text = i
end
end

-- Table inserting and removing and printing
for i, player in pairs(Players:GetPlayers()) do
table.insert(survivers, player.Name)
pcall(function()
player.Character.Humanoid.Died:connect(function()
table.remove(survivers, player.Name)
table.insert(dead, player.Name)
end)
end)
end

GetSurvivors()


-- /Table inserting and removing and printing

--wait(120)

end
Report Abuse
Grove537 is not online. Grove537
Joined: 05 Feb 2010
Total Posts: 3478
01 Dec 2011 06:11 PM
Why do you have "--" in random spots :l

~The greatest free model is your mind~
Report Abuse
skipperguy12 is not online. skipperguy12
Joined: 09 Oct 2009
Total Posts: 955
01 Dec 2011 06:15 PM
^For me to debug it. Incase I really fail at editing, I dont have to reload my script, when I can just delete the --'s. =\
Report Abuse
skipperguy12 is not online. skipperguy12
Joined: 09 Oct 2009
Total Posts: 955
01 Dec 2011 06:20 PM
Bump...
Report Abuse
skipperguy12 is not online. skipperguy12
Joined: 09 Oct 2009
Total Posts: 955
01 Dec 2011 08:17 PM
Bump, HELP!
Report Abuse
skipperguy12 is not online. skipperguy12
Joined: 09 Oct 2009
Total Posts: 955
02 Dec 2011 02:28 PM
Bbbbbbbbbuuuuummmmmmmmmmmmmmmmppppppppkkthanxbaibai
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
02 Dec 2011 02:51 PM
Looks hard to fix. >:/
Report Abuse
skipperguy12 is not online. skipperguy12
Joined: 09 Oct 2009
Total Posts: 955
02 Dec 2011 04:57 PM
^Lol....

BUM:P!!!!!!!!!!!!!!!!!!!!!!!!!
Report Abuse
skipperguy12 is not online. skipperguy12
Joined: 09 Oct 2009
Total Posts: 955
02 Dec 2011 05:44 PM
BUMP! Y U NO HELP ME?
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
02 Dec 2011 05:45 PM
Coolstorybro.

tl;dr
Report Abuse
skipperguy12 is not online. skipperguy12
Joined: 09 Oct 2009
Total Posts: 955
03 Dec 2011 07:22 AM
Coolhelpbro

Now, help me for real! BUMP!
Report Abuse
ReactorINC is not online. ReactorINC
Joined: 24 Nov 2011
Total Posts: 84
03 Dec 2011 07:25 AM
You called #survivers and there's not a table with survivers.
Report Abuse
skipperguy12 is not online. skipperguy12
Joined: 09 Oct 2009
Total Posts: 955
03 Dec 2011 07:36 AM
@Reactor, its there.... Look around the top, inside of the "Tables =3" comment. I have :

survivers = {}
Report Abuse
skipperguy12 is not online. skipperguy12
Joined: 09 Oct 2009
Total Posts: 955
03 Dec 2011 06:48 PM
Bump...
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
04 Dec 2011 06:58 AM
*Thinking very very hard*
Report Abuse
skipperguy12 is not online. skipperguy12
Joined: 09 Oct 2009
Total Posts: 955
04 Dec 2011 07:32 AM
*Waiting for a very very long time*
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
04 Dec 2011 08:09 AM
*Gives up*
Report Abuse
skipperguy12 is not online. skipperguy12
Joined: 09 Oct 2009
Total Posts: 955
04 Dec 2011 08:16 AM
*Reads miros post, thinks: DANG IT!*
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
04 Dec 2011 02:12 PM
*Doing history homework due tomorrow or else I get a detention* BRB xD
Report Abuse
skipperguy12 is not online. skipperguy12
Joined: 09 Oct 2009
Total Posts: 955
05 Dec 2011 05:51 PM
*Guesses miros grade: 7th? 9th? Idk, this kid is hard to guess.... **Gives up*** Lulz.
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
06 Dec 2011 10:15 AM
7th grade...*Does math homework about trigonometry*
Report Abuse
skipperguy12 is not online. skipperguy12
Joined: 09 Oct 2009
Total Posts: 955
06 Dec 2011 12:23 PM
I haz a trick for you...

Remember this:

Soh Cah Toa

Now, what is that? Instead of remembering, sin is equal to opposite over hypotenuese, and cosin is equal to adj over hyp, and tan is equal to opp over adj, you remember soh cah toa. Bewmz, your done......... NOW FIXZ MAI SCRIPT! BUMPORZ!
Report Abuse
TheMyrco is not online. TheMyrco
Joined: 13 Aug 2011
Total Posts: 15105
06 Dec 2011 12:32 PM
Let me take a look.

~Myrco; Music lover, nederlands/dutch and a scripter
Report Abuse
TheMyrco is not online. TheMyrco
Joined: 13 Aug 2011
Total Posts: 15105
06 Dec 2011 12:47 PM
It was quite a mess, I just made it into something:

local Workspace = Game:GetService("Workspace")
local Players = Game:GetService("Players")
local MapParents = Game:GetService("Lighting")
local msg = Instance.new("Message", Workspace)
local playas = Players:GetPlayers()
local Maps = {}
local survivers = {}
local dead = {}
local CurrentMap

for _,Map in pairs(MapParents:GetChildren()) do
    table.insert(Maps, Map)
end

function Updatemap()
    if type(CurrentMap) == "userdata" then
        CurrentMap.Parent = MapParents ---?
        CurrentMap:remove()
    end
    msg.Text = "Chosing a random map"
    local NewMap = Maps[ math.random(1, #Maps) ]
    NewMap.Parent = Workspace
    CurrentMap = NewMap
    msg.Text = "Map Chosen: "..NewMap.Name.."!"
    wait(3)
    msg.Text = ""
end

 function GetSurvivors()
    local String = ""
    if #survivers == 0 then
        msg.Text = "No survivors"
    end
    wait(2.5)
    msg.Text = table.concat(survivers, ", ")
    wait(3)
    msg.Text = ""
end

while true do
    msg.Text = "Take a break, 15 seconds before next round!"
    wait(2)
    msg.Text = ""
    playas = Players:GetPlayers()
    for _,v in pairs (playas) do
        v.Character.Torso.CFrame = Workspace.TeleSpawn.CFrame + Vector3.new(5,5,0)
    end
    for i = 15, 0, -1 do
        for _,v in pairs(playas) do
            v.PlayerGui.CountdownGui.Frame.TextButton.Text = i
        end
        wait(1)
    end
    msg.Text = "Its game time!"
    wait(2)
    msg.Text = ""
    UpdateMap()
    for i, player in pairs(playas:GetPlayers()) do
        table.insert(survivers, player.Name)
        pcall(function()
            coroutine.resume(coroutine.create(function()
                player.Character.Humanoid.Died:connect(function()
                    table.remove(survivers, player.Name)
                    table.insert(dead, player.Name)
                end)
            end))
        end)
    end
    GetSurvivors()
end

~Myrco; Music lover, nederlands/dutch and a scripter
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
06 Dec 2011 02:17 PM
@Skipper

I only started learning trigonommetry since the day I started posting in this thread. It's really quite hard to me because I'm young D:
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