Answered by
5 years ago Edited 5 years ago
So theres alot that can be changed and made better on yours.
I made my script very quickly before I had to leave.
Heres an example, Id recommend you to base yours off of mine. I dont have much time to explain, im sorry but im being rushed out the door rn.
01 | local Players = game:GetService( "Players" ) |
02 | local Http = game:GetService( "HttpService" ) |
03 | local Datastore = game:GetService( "DataStoreService" ) |
05 | local Admins = { "Player1" } |
14 | local Banned = Datastore:GetDataStore( "Banned" ) |
17 | if type (p) = = "number" then |
19 | elseif type (p) = = "userdata" then |
21 | elseif type (p) = = "string" then |
22 | if Players:FindFirstChild(p) then |
23 | return Players [ p.Name ] .UserId |
32 | if type (p) = = "userdata" then |
34 | elseif type (p) = = "number" then |
35 | return Players:GetPlayerByUserId(p) |
36 | elseif type (p) = = "string" then |
37 | if Players:FindFirstChild(p) then |
45 | if Admins [ p ] or Admins [ GetUserId(p) ] then |
48 | for _,v in next ,GroupIds do |
49 | local player = GetPlayer(p) |
50 | if player and player:IsInGroup(v.Id) and player:GetRankInGroup(v.Rank) > = NeededRank then |
59 | Players.PlayerAdded:Connect( function (p) |
60 | if Banned:GetAsync(p.UserId) then |
63 | p.Chatted:Connect( function (m) |
64 | if IsAdmin(p) = = true then |
65 | if m:sub( 0 , 3 ) = = "/e " then |
68 | if m:sub( 0 , 5 ) = = "!kick" then |
69 | local target = m:sub( 7 ) |
71 | local player = Players:FindFirstChild(target) |
75 | print 'i prob got the subbing wrong, just +1' |
77 | elseif m:sub( 0 , 4 ) = = "!ban" then |
78 | local target = m:sub( 7 ) |
80 | local player = Players:FindFirstChild(target) |
82 | Banned:SetAsync(player.UserId, true ) |