Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- This script is only intended for use on the Power Simulator VIP server for when people disturb the peace.
- ]]
- local Players = game:GetService('Players')
- local LocalPlayer = Players.LocalPlayer
- local prefix = '!'
- local cmds, permissions
- function addChatEvent(player)
- if ( type(player) == 'userdata' and permissions[player.UserId] ) then
- player.Chatted:Connect(function(msg)
- local args = {}
- for i in string.gmatch(msg, "%S+") do args[#args+1] = i end
- local cmd = args[1]:sub(1+prefix:len(), args[1]:len())
- if ( msg:sub(1,prefix:len()) == prefix and cmd:len() > 0 ) then
- local call = permissions[player.UserId][cmd]
- if ( call ) then
- call(player, args)
- end
- end
- end)
- end
- end
- function initiate(_, __)
- cmds, permissions = _, __
- Players.PlayerAdded:Connect(function(player)
- addChatEvent(player)
- end)
- for index, player in ipairs(Players:GetChildren()) do
- addChatEvent(player)
- end
- end
- return initiate()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement