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: How do I make a team deadly? (damage on touch, like a zombie)

Previous Thread :: Next Thread 
Edawg649 is not online. Edawg649
Joined: 19 Jul 2011
Total Posts: 23
22 Dec 2011 12:06 PM
I have a script that is supposed to do that, but I don't know where to put it. I tried putting it in the team that I wanted, but it didn't work. Any help?
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
22 Dec 2011 12:07 PM
If you made the script you would know where to put it.


~= Welds stink.=~
Report Abuse
Edawg649 is not online. Edawg649
Joined: 19 Jul 2011
Total Posts: 23
22 Dec 2011 12:08 PM
I didn't say I made it...
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
22 Dec 2011 12:10 PM
Not alot of ppl here fix or help you with free models.
But some will but not alot.

~= Welds stink.=~
Report Abuse
hogman825 is not online. hogman825
Joined: 08 Jul 2008
Total Posts: 35
22 Dec 2011 12:12 PM
mind posting the script?
Report Abuse
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
22 Dec 2011 12:37 PM
@Hog
He doesn't have one, he is asking how to make one.

@Poster_Of_This_Thread
You make it with a simple .Touched script, obviously :D

    Players = Game:GetService("Players")
    
    DeadlyTeamColor = BrickColor.new("Put deadly team color here")
    HitDamage = 5 -- How much each limb does
    LimbsThatDoDamage = {"Left Arm", "Right Arm", "Left Leg", "Right Leg"}
    -- You can add limb names or take some away.
    
    LimbTouched = function(Hit)
        local Player = Players:GetPlayerFromCharacter(Hit.Parent)
        local Humanoid = Hit.Parent:FindFirstChild("Humanoid")
        
        if Player ~= nil then
            if Player.TeamColor ~= DeadlyTeamColor then
                if Humanoid then
                    Humanoid:TakeDamage(HitDamage)
                end
            end
        
        else
            if Humanoid then
                Humanoid:TakeDamage(HitDamage)
            end
        end
    end
    
    CharacterAdded = function(NewCharacter)
        local Player = Players:GetPlayerFromCharacter(NewCharacter)
        if not Player then return end
        if Player.TeamColor ~= DeadlyTeamColor then return end
        
        for _, Part in pairs(NewCharacter:GetChildren()) do
            for _, LimbName in pairs(LimbsThatDoDamage) do
                if Part.Name:lower() == LimbName:lower() and Part:IsA("BasePart") then
                    Part.Touched:connect(LimbTouched)
                end
            end
        end
        
        -- If you would want to make there arms raised too, you would modify that
        -- in this function.
    end
    
    PlayerAdded = function(Player)
        Player.CharacterAdded:connect(CharacterAdded)
    end
    
    Players.PlayerAdded:connect(PlayerAdded)
Report Abuse
Edawg649 is not online. Edawg649
Joined: 19 Jul 2011
Total Posts: 23
22 Dec 2011 12:37 PM
I cant go on roblox studio right now to actually copy paste the script, but heres the link:

http://www.roblox.com/Damage-Death-Script-JJ5x5-item?id=562838
Report Abuse
Edawg649 is not online. Edawg649
Joined: 19 Jul 2011
Total Posts: 23
22 Dec 2011 12:48 PM
Oh, that works too xD Thanks Ill see if it works :P
Report Abuse
Edawg649 is not online. Edawg649
Joined: 19 Jul 2011
Total Posts: 23
22 Dec 2011 12:54 PM
Sorry, i cant delete or edit my posts.

I filled in the limbs and damage, but I don't know where to put the script. Workspace?
Report Abuse
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
22 Dec 2011 12:56 PM
Actually, it doesn't matter where you put the script. But Workspace is fine.
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