|
| 15 Oct 2012 12:13 AM |
| I want to make it so if you die a more than twice in 30 seconds you get kicked from the game, (im not sure if you can kick someone from a game so if you can't i still need the script) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 15 Oct 2012 12:14 AM |
| It's possible, its gonna be a longish script though |
|
|
| Report Abuse |
|
|
Aerideyn
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 1882 |
|
|
| 15 Oct 2012 12:38 AM |
It's pretty easy to kick someone from a game, just remove their player object.
Other than that, connect to humanoid.Died in a local script and insert an int value into a model in workspace, save the DistributedGameTime into it and name the int value after the player.
then every time a player dies, just check if there is already a value there named after them from within the last 30 seconds. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 15 Oct 2012 01:02 AM |
| Use like a while true and some tables |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2012 01:07 AM |
| Im relatively new to taking on more complex tasks like this and i dont even know how to write it out. and all i need the code for is to fix a bug where every time players reset they get to send out a message. so i want to make it so they dont do it twice. |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2012 01:09 AM |
| If you could elaborate a simple ban script i could figure out the rest from there |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 15 Oct 2012 01:13 AM |
local Banned = {}
function BanPlayer(PlayerName) if game.Players:FindFirstChild(PlayerName) ~= nil then table.insert(Banned, PlayerName) game.Players:FindFirstChild(PlayerName):Destroy() end end game.Players.ChildAdded:connect(function(Player) for i,v in pairs(Banned) do if v == Player.Name then Player:Destroy() end end end) |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2012 10:01 AM |
local PlayerS = {}
game.Players.PlayerAdded:connect(function(p) PlayerS[p.Name] = {0, {0, 0}} p.CharacterAdded:connect(function(c) wait() c.Humanoid.Died:connect(function() PlayerS[p.Name][1] = PlayerS[p.Name][1] + 1 if PlayerS[p.Name][1] > 1 then if PlayerS[p.Name][2][1] < tick()-30 then table.remove(PlayerS[p.Name][2], 1) table.insert(PlayerS[p.Name][2], tick()) if PlayerS[p.Name][2][1] < tick()-30 table.remove(PlayerS[p.Name][2], 1) table.insert(PlayerS[p.Name][2], tick()) else p:Remove() end else p:Remove() end end end) end) end) |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2012 01:37 PM |
game:GetService("Players").PlayerAdded:connect(function(p) Delay(.5,function()p:LoadCharacter()end) local last_death=0 p.CharacterAdded:connect(function(c) c:FindFirstChild("Humanoid").Died:connect(function() if last_death~=0 and tick()-last_death>=30 then p:Destroy() else last_death=tick() end end) end) end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 15 Oct 2012 03:48 PM |
PreviousDeath = 0
game.Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Char) Char.Humanoid.Died:connect(function()
if PreviousDeath == 0 then
for i = 30, 0, -1 do PreviousDeath = i wait(1) end
elseif PreviousDeath > 0 then Player:Destroy()
end end) end) end)
------------------------- ~thedestroyer115, http://www.roblox.com/String-Word-Randomizer-item?id=94754887~
|
|
|
| Report Abuse |
|
|
|
| 15 Oct 2012 03:49 PM |
Mine works. It's simple. OP use mine. kthx
------------------------- ~thedestroyer115, http://www.roblox.com/String-Word-Randomizer-item?id=94754887~
|
|
|
| Report Abuse |
|
|
|
| 15 Oct 2012 03:50 PM |
@destroyer
That wouldn't work for ALL players. But I absolutely love how simple it is. The logic behind it is amazing. Kudos! |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2012 03:51 PM |
Thanks! That means a lot to me.
------------------------- ~thedestroyer115, http://www.roblox.com/String-Word-Randomizer-item?id=94754887~
|
|
|
| Report Abuse |
|
|
|
| 15 Oct 2012 05:20 PM |
This chunk of code right here is what I was looking for i had an idea similar to this but the way i planned on writing probably was terribly wrong. Thank you
local PlayerS = {}
game.Players.PlayerAdded:connect(function(p) PlayerS[p.Name] = {0, {0, 0}} p.CharacterAdded:connect(function(c) wait() c.Humanoid.Died:connect(function() PlayerS[p.Name][1] = PlayerS[p.Name][1] + 1 if PlayerS[p.Name][1] > 1 then if PlayerS[p.Name][2][1] < tick()-30 then table.remove(PlayerS[p.Name][2], 1) table.insert(PlayerS[p.Name][2], tick()) if PlayerS[p.Name][2][1] < tick()-30 table.remove(PlayerS[p.Name][2], 1) table.insert(PlayerS[p.Name][2], tick()) else p:Remove() end else p:Remove() end end end) end) end) |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2012 05:30 PM |
My version:
~ Local Script ~
local Player = game.Players.LocalPlayer Player.Character.Humanoid.Died:connect(function() if Player:findFirstChild("Kill Tag") then Player:Remove() else local Tag = Instance.new("BoolValue", Player) Tag.Name = "Kill Tag" game.Debirs:AddItem(Tag, 30) end end) |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2012 05:38 PM |
| I f i put that in it will tell me then expected near "". i dont know where to put the then |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 15 Oct 2012 05:57 PM |
OnEntered,Add: Deaths (IntValue) toPlayer
OnDied: Deaths.Value=Deaths.Value+1
--Loop [ScriptitWOrkspace] While true and wait() do for i,v in pairs(game.Players:GetChildren()) do if v:FindFirstChild("Deaths") ~= nil then if v["Deaths"].Value > 0 then v:Destroy() end end end end |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2012 06:57 PM |
But. I dun liek makin new valuez! |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2012 06:59 PM |
Why wouldn't mein work? :C
yu made me cry when yu said tht
its k im okk now
;c |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2012 07:05 PM |
| The player would get kicked the second time they died if he died AFTER 30 seconds. :3 |
|
|
| Report Abuse |
|
|
| |
|