View previous topic :: View next topic |
Author |
Message |
Akhenderson Robloxian Shyguy
Joined: 30 Mar 2008 Posts: 209 Location: Corneria
|
Posted: Mon Jun 30, 2008 3:46 pm Post subject: Teams getting different weapons. |
|
|
I need a script that when someone spawns they get weapons
depending on what team they are on. I need it for my future places
where Elementals (Players) fight one another using different weapons.
I mean does a Fire player with the power of Nature make sence? _________________ My INT score was lowered just by
being near those noobs who build
pointless places that instantly get
popular. |
|
Back to top |
|
|
ultrameep Newbie
Joined: 01 Jul 2008 Posts: 4
|
Posted: Wed Jul 02, 2008 5:37 am Post subject: |
|
|
--[[how to use
1) make a team in Teams
2) put all the tools you want in the team object
ex.
[+] Workspace
[+] Players
[+] Lighting
[-] Teams
----|[-] Team1
--------|- tool1
--------|- tool2
----|[-] Team2
--------|- tool3
--------|- tool4
[-] StarterPack
----|- Reset
that will give tool1 and tool2 to people on Team1, and tool3 and tool4 to people on Team2
note: you can put stuff in the StarterPack if you want everyone to get it still (ex. reset tool)
--]]
function getTeam(player)
local c = player.TeamColor
local teams = game.Teams:GetChildren()
for i = 1,#teams do
if teams[i].TeamColor == c then return teams[i] end
end
return nil
end
function giveWeps(player)
local team = getTeam(player)
if team ~= nil then
local weps = team:GetChildren()
for i = 1,#weps do
weps[i]:Clone().Parent = player.Backpack
end
end
end
function new(newPlayer)
newPlayer.Changed:connect(function (prop)
if prop == "Character" and newPlayer.Character ~= nil then
giveWeps(newPlayer)
end
end)
end
game.Players.PlayerAdded:connect(new) |
|
Back to top |
|
|
Akhenderson Robloxian Shyguy
Joined: 30 Mar 2008 Posts: 209 Location: Corneria
|
Posted: Wed Jul 02, 2008 2:12 pm Post subject: |
|
|
say thanks! I can finish my elemental Battlefield now. _________________ My INT score was lowered just by
being near those noobs who build
pointless places that instantly get
popular. |
|
Back to top |
|
|
|