|
| 30 Apr 2017 11:50 AM |
die?
say like a round starts,i want their names to be put into a table then when they die,their names get removed from the table.
I want to put it in my script vvv
while true do if game.Players.NumPlayers >= 1 then game.Workspace.Intermission.Playing = true for i = 10, 1, -1 do textLabel.Text = "Intermission: "..i wait(1) end textLabel.Text = "Intermission: 0" wait(1) textLabel.Text = "I see you're looking at this text ;)" wait() textLabel.Text = " " wait(1) textLabel.Text = "pls w8 we make map ;,,(" wait(5) local mapOne = game:GetService("ReplicatedStorage") mapcloned = mapOne.Map:Clone() mapcloned.Parent = game.Workspace textLabel.Text = "Making Map,please wait..." target = CFrame.new(2, 318.5, -21) for i, player in ipairs(game.Players:GetChildren()) do if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then player.Character.HumanoidRootPart.CFrame = target + Vector3.new(0, i * 5, 0) end end wait() textLabel.Text = "" else textLabel.Text = "Not enough players.Need at least 2 people." end wait(1) end
print("successful")
ok |
|
|
| Report Abuse |
|
|
NilLogic
|
  |
| Joined: 08 Apr 2016 |
| Total Posts: 1369 |
|
|
| 30 Apr 2017 11:50 AM |
I hope that the link(s) below will help answer your question.
wiki.roblox.com/index.php?title=Making_a_New_Game wiki.roblox.com/index.php?title=Intro_to_Scripting wiki.roblox.com/index.php?title=Vector3_Math
I am just a friendly bot trying to help you, I will get smarter! Feel free to suggest links, the current config can be found on pastebin: aiudMAhN Join the fan group: https://www.roblox.com/My/Groups.aspx?gid=3201548 |
|
|
| Report Abuse |
|
|
Thedagz
|
  |
| Joined: 10 Mar 2012 |
| Total Posts: 798 |
|
|
| 30 Apr 2017 11:53 AM |
local PlayersTable = {}
PlayersTable[#PlayersTable + 1] = Player -- Adding
for i = 1,#PlayersTable do -- removing local PlayerInTable = PlayersTable[i] if PlayerInTable == Player then table.remove(PlayersTable,i) break end end |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2017 12:02 PM |
I seriously don't know how that works xd
ok |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2017 12:04 PM |
| I think there is a function that is called .Changed I don't remember how it's used. Look on the wiki. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2017 12:05 PM |
y would u need to use changed there is a died event and tables dont have 'changed' without metamethods |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2017 12:10 PM |
idk if i should bump or not,wait...
ok |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2017 12:16 PM |
u can try it with the dictionary version too
local list = {} for _, player in ipairs( alive_players ) do list[ player ] = true --get humanoid humanoid.Died:connect( function() list[ player ] = nil CheckWinners() end ) end
--to see if there is only 1 person left alive: next( player, next( player ) )
|
|
|
| Report Abuse |
|
|