Roblox Scripting Tutorial: Giving Different Teams Different Weapons

Channel:
Subscribers:
2,110
Published on ● Video Link: https://www.youtube.com/watch?v=loeqw17yKc8



Roblox
Game:
Roblox (2006)
Category:
Tutorial
Duration: 2:06
11,208 views
168


Script:
--Just put weapons in the team.
function teamFromColor(color)
for _,t in pairs(game:GetService("Teams"):GetChildren()) do
if t.TeamColor==color then return t end
end
return nil
end

function onSpawned(plr)
local tools = teamFromColor(plr.TeamColor):GetChildren()
for _,c in pairs(tools) do
c:Clone().Parent = plr.Backpack
end
end

function onChanged(prop,plr)
if prop=="Character" then
onSpawned(plr)
end
end

function onAdded(plr)
plr.Changed:connect(function(prop)
onChanged(prop,plr)
end)
end

game.Players.PlayerAdded:connect(onAdded)

Be sure to follow me on Twitter after rating, commenting, and subscribing!
https://twitter.com/Rrrrry123

Also, follow me on Twitch for some live streams!
http://www.twitch.tv/Rrrrry123

Want to help make this channel better? You can donate to me via Roblox Robux!
http://ow.ly/En9x30hdeWy

Other great YouTubers!
Valiant Fella: http://ow.ly/zZUfu
Leo Iizuka: http://ow.ly/A5grV
MissAdorkableBubbles: http://ow.ly/BNhxx







Tags:
Rrrrry123
Twitter
Ryan
Block
Brick
Roblox
Minecraft
Runescape
Spyro
Let's
Play
Nostalgia
Talk
Valiant
Fella
Leo
Iizuka
HTML
Tutorial
Web
design
Lua
help
Dark
Souls
Destiny
script
scripting
team
weapons
differnt



Other Statistics

Roblox Statistics For RyGuyGaming

At present, RyGuyGaming has 459,946 views spread across 106 videos for Roblox, and roughly a days worth of Roblox videos were uploaded to his channel. This makes up 17.76% of the content that RyGuyGaming has uploaded to YouTube.