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 you make a certain team have unlimited forcefield?

Previous Thread :: Next Thread 
h5h1hdhowes is not online. h5h1hdhowes
Joined: 31 Oct 2010
Total Posts: 1191
24 Jul 2014 01:27 PM
I'm making a battle game, and you get to choose your team, but there's a team name "Choosing" and you have the rocket launchers there. Is there a way to make that team have unlimited force field?
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
24 Jul 2014 01:29 PM
SpawnLocations (spawns) have a property called "ForceFieldDuration". You can make that number ridiculously large (math.huge), or you could just find out how to create a ForceField object and parent it to each spawning player on that team. I'd use functions for that second method.

-I just hit 4k posts, made a lengthy speech lol: http://www.roblox.com/Forum/ShowPost.aspx?PostID=141338105-
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
24 Jul 2014 01:29 PM
-Loop through le team
-Check if on team
-CharacterAdded event
-Insert FF
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
24 Jul 2014 01:30 PM
@max

that speech is useless, who makes a speech at 4k????
Report Abuse
GollyGreg is not online. GollyGreg
Joined: 22 May 2008
Total Posts: 21835
24 Jul 2014 01:36 PM
--real choppy code ahead
function isOnTeam(Player, TeamColor)
    return Player.TeamColor == BrickColor.new(TeamColor)
end

--now that we have a isOnTeam method, we can use
--this to award a ForceField

game:GetService("Players").PlayerAdded:connect(function(Player)
    --CharacterAdded will fire every respawn
    Player.CharacterAdded:connect(function(Character)
        if isOnTeam(Player, "White") then
            --this lil bit adds the ForceField until we destroy it
            local ForceField = Instance.new("ForceField", Character)

            --now to wait until the TeamColor changes
            Player.Changed:connect(function()
                if not isOnTeam(Player, "White") then
                    ForceField:Destroy()
                end
            end)
        end
    end)
end)
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
24 Jul 2014 01:37 PM
@duel,
because i'm not doing it for 5k, and i can do what i want. gg
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
24 Jul 2014 01:38 PM
"because i'm not doing it for 5k, and i can do what i want. gg"

you can do what you want but what you do can be stupid as well and is

ggnore
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