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: Anti-Team Kill Script

Previous Thread :: Next Thread 
mattrock1243 is not online. mattrock1243
Joined: 23 Nov 2010
Total Posts: 403
06 Jun 2013 07:00 PM
Hey, can one of you fellow Robloxians post the scripts down there or give me a link to a model? I really need it,
Thanks,
Mattrock1243

It says 'All Things Roblox'
Report Abuse
Moonfang5 is not online. Moonfang5
Joined: 04 Sep 2009
Total Posts: 2523
06 Jun 2013 07:01 PM
We have Script helpers for a reason.
Report Abuse
mattrock1243 is not online. mattrock1243
Joined: 23 Nov 2010
Total Posts: 403
06 Jun 2013 07:02 PM
You helped me -100%
Report Abuse
thegreenHawk is not online. thegreenHawk
Joined: 02 Mar 2012
Total Posts: 1764
06 Jun 2013 07:02 PM
http://www.roblox.com/Forum/ShowForum.aspx?ForumID=20

The Melon Lord Of ATR.
Report Abuse
Moonfang5 is not online. Moonfang5
Joined: 04 Sep 2009
Total Posts: 2523
06 Jun 2013 07:02 PM
print("TK script loaded.")

function onHumanoidDied(humanoid, player)
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
if (killer ~= nil) then
handleTKs(player, killer)
end
end

function onPlayerRespawn(property, player)

if property == "Character" and player.Character ~= nil then
local humanoid = player.Character.Humanoid
local p = player
local h = humanoid
humanoid.Died:connect(function() onHumanoidDied(h, p) end )
end
end

function getKillerOfHumanoidIfStillInGame(humanoid)

local tag = humanoid:findFirstChild("creator")

if tag ~= nil then
local killer = tag.Value
if killer.Parent ~= nil then
return killer
end
end

return nil
end

function handleTKs(player, killer)
if (killer.TeamColor == player.TeamColor) then
killer.Character.Humanoid.Health = 0
end
end

function onPlayerEntered(newPlayer)
while true do
if newPlayer.Character ~= nil then break end
wait(3)
end

local humanoid = newPlayer.Character.Humanoid

humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )
newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )
end

game.Players.ChildAdded:connect(onPlayerEntered)
Report Abuse
thegreenHawk is not online. thegreenHawk
Joined: 02 Mar 2012
Total Posts: 1764
06 Jun 2013 07:03 PM
And if you need help go to Catalog>Models>Anti-Team Kill script Done.

The Melon Lord Of ATR.
Report Abuse
thegreenHawk is not online. thegreenHawk
Joined: 02 Mar 2012
Total Posts: 1764
06 Jun 2013 07:03 PM
The guy above me helped nao .

The Melon Lord Of ATR.
Report Abuse
mattrock1243 is not online. mattrock1243
Joined: 23 Nov 2010
Total Posts: 403
06 Jun 2013 07:05 PM
Thanks, for helping :)
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
06 Jun 2013 07:05 PM
Wrong forum.
Report Abuse
rhyperior897 is not online. rhyperior897
Joined: 11 Mar 2012
Total Posts: 7847
06 Jun 2013 07:06 PM
That comment wasn't needed
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