admins = {"HydroDivinity"}
game.Players.PlayerAdded:connect(function(pl)
for i,v in pairs(admins) do
if v == pl.Name then
pl.Chatted:connect(function(mes)
if mes:sub(1,4) == "add " then
print(pl.Name.." is running the "..mes:sub(1,3).." command")
if mes:sub(5,7) == "c " then
print(pl.Name.." is changing somebody's coin-value")
end
end
end)
end
end
end)
Alright, so basically, I have a gui in-game for currency. I want admins to be able to change people's currency depending on what they write on the cmd.
For example;
add c HydroDivinity 6
Not sure how to make "HydroDivinity" come before the 6 value

1 comment
This question is very well put together. You highlight the needs with an example, give a small code sample (not posting the entire thing), and clearly state your question at the bottom. Try to make your title more vague next time however. This is too specific with "admin commands". Instead talk about finding patterns in strings.