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

Group command into Team command. Can I have help?

Asked by
moo1210 587 Moderation Voter
6 years ago

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.

0
So what is the problem you ran into? hiimgoodpack 2009 — 6y
0
Yeah.. I don't understand what you mean here. What is a "team command"? adark 5487 — 6y

1 answer

Log in to vote
-1
Answered by 6 years ago

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
0
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. moo1210 587 — 6y
0
explain_your_code Goulstem 8144 — 6y
Ad

Answer this question