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 » Scripters
Home Search
 

Re: Anti Teamkill

Previous Thread :: Next Thread 
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
24 Jul 2013 11:13 AM
So I need a anti teamkill script I can paste into workspace, I think of making the script inside a character.
I dont know how I would use the (damage) tooken from the character in the function heal()

Ex:
local char = script.Parent
local human = char.Humanoid
local health = human.Health
local plr = game.Players[char.Name]

function heal(damage)
if human:FindFirstChild("creator") then
local cr = game.Players[creator.Value]
if plr.TeamColor == cr.TeamColor then
human.Health = human.Health + damage
end
end

human.Changed:connect(function(prop)
if prop == "Health" then
heal()
end
end)
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
24 Jul 2013 11:15 AM
bump
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
24 Jul 2013 11:24 AM
bump
Report Abuse
Parthax is not online. Parthax
Joined: 27 Apr 2011
Total Posts: 6941
24 Jul 2013 11:39 AM
make a variable beforehand so that you can heal their maxhealth minus this variable, then just set the variable to their current health
logic
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
24 Jul 2013 12:03 PM
Example
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Jul 2013 12:04 PM
Wrong forum
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
24 Jul 2013 12:46 PM
There's no way to make a script in the workspace to do anti-teamkill. It will only do mostly-anti-teamkill. Also, it won't work at all for any sort of rockets that use explosions, or do 1-hit kills in other ways.

So, you really need to have the weapons aware of teams, not just a script in the workspace.
Report Abuse
Parthax is not online. Parthax
Joined: 27 Apr 2011
Total Posts: 6941
24 Jul 2013 01:18 PM
@stravant
reload their character, set their torso to the cframe that it was before they died, set their health and maxhealth to what it was before they took damage, whenever they take damage
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
24 Jul 2013 01:53 PM
Not a solution since loading the tools in the backpack takes up to a few seconds, so even if you do it perfectly there will be a noticeable hiccup.
Report Abuse
Parthax is not online. Parthax
Joined: 27 Apr 2011
Total Posts: 6941
24 Jul 2013 02:01 PM
clone tools before they die, and just parent them, and wait for a new tool that they would receive, then destroy it
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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