Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local MainCmd = "script"
- local CmdSub = #MainCmd + 1
- for _, Child in pairs(script:GetChildren()) do
- if Child:IsA("Script") then
- Child.Disabled = true
- end
- end
- function OnChatted(owner, message)
- if message:sub(1, CmdSub) == MainCmd .."/" then
- local scriptChildren = script:GetChildren()
- for _, Child in pairs(scriptChildren) do
- if message:sub(CmdSub + 1) == Child.Name:lower() then
- local New = Child:Clone()
- New.Parent = owner.Backpack or owner.PlayerGui
- New.Disabled = false
- end
- end
- end
- end
- function ConnectPlr(name)
- for _, PossiblePlayer in pairs(Players:GetChildren()) do
- if PossiblePlayer:IsA("Player") then
- local Player = PossiblePlayer
- if Player.Name == name then
- Player.Chatted:Connect(function(MESSAGE)
- OnChatted(Player, MESSAGE:lower())
- end)
- else
- error("No player found!")
- end
- end
- end
- end
- return ConnectPlr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement