How to change
if msg:lower():sub(1,5) == "give " and plr:GetRankInGroup(2788849) >= 7 then
into a team command? This is for a hotel that will give a tool to someone. I only put the part I need help with.
How to change
if msg:lower():sub(1,5) == "give " and plr:GetRankInGroup(2788849) >= 7 then
into a team command? This is for a hotel that will give a tool to someone. I only put the part I need help with.
You can use :GetPlayers().
local plr = --Edit this variable somewhere in your script so I know the player we are looking for.
if msg:lower():sub(1,5) == "give " and plr:GetRankInGroup(2788849) >= 7 then
local found = false --This basically turns true if the player is found.
for i, v in pairs(game:GetService('Teams')['Insert team name here']:GetPlayers()) do
if v.Name == plr.Name then
found = true
break
end
end
if found then
--insert the rest of your script here
end
end
local plr = --Edit this variable somewhere in your script so I know the player we are looking for. Am looking for the player that chatted it.
explain_your_code
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
So what is the problem you ran into?
Yeah.. I don't understand what you mean here. What is a "team command"?