Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a team only tool giver?

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

✓ Accepted answer

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!

3 comments

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!

0

ok, i will try to fix it

0

Thank You much!

This discussion is preserved as it was. New answers, comments, and votes are closed.