Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a team only tool giver?

Asked by 9 years ago

I am building a tycoon and I need help building a team only tool giver. I wanna be able to set it to a specific team and so when a player touches it, only the people with the same team color can take it. I also want it to set it to their starter pack.

I have no idea how to even start building this could I get some help?

2 answers

Log in to vote
1
Answered by 9 years ago

1 Always keep this inside the game :) 2 just put the tool you want to give to the teams into their team under the Teams section

PUT In TO A Script




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 = fromTeamCOlor(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)

Hope this helps!

0
I dont think you understood but thanks for the reply! I want the owner of the tycoon to have to purchase this model first and then when other members of the same team color that the model is set to will then add the tool to that persons starter pack. I dont want them to get the tools until they get them from this giver. Thanks! MULTACxlr8 20 — 9y
0
ok, i will try to fix it ioutragous 0 — 9y
0
Thank You much! MULTACxlr8 20 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

Can someone help me please?

Answer this question