Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Kage Commands
- local Players = game:GetService("Players")
- local HTTPService = game:GetService("HttpService")
- local SS = game:GetService("ServerStorage")
- local Storage = game:GetService("ReplicatedStorage")
- local Remotes = Storage:WaitForChild("Kage_Remotes")
- local Stats = SS:WaitForChild(".stats")
- local Url = ''
- local Whitelisted = {
- [45146698] = 'Hokage',
- [461653567] = 'Kazekage',
- [1737168766] = 'Mizukage',
- [82540849] = 'Raikage',
- [563523142] = 'Tsuchikage',
- [410311110] = 'Otokage',
- };
- local KageToVillage = {
- Hokage = 'Leaf',
- Kazekage = 'Sand',
- Mizukage = 'Mist',
- Raikage = 'Cloud',
- Tsuchikage = 'Stone',
- Otokage = 'Sound',
- };
- local VillageToNumber = {
- Leaf = 1,
- Cloud = 2,
- Mist = 3,
- Rain = 4,
- Sand = 5,
- Stone = 6,
- Rogue = 7,
- Sound = 8,
- };
- local function adjustRankingPromo(cur)
- --0 = academy stud, 1 = genin, 2 = chunin, 3 = jonin, 4 = sepc. jonin
- if cur == 'Academy Student' then
- return 'Genin'
- elseif cur == 'Genin' then
- return 'Chunin'
- elseif cur == 'Chunin' then
- return 'Jonin'
- elseif cur == 'Jonin' then
- return 'Spec. Jonin'
- elseif cur == 'Spec. Jonin' then
- return 'Spec. Jonin'
- end
- end
- local function adjustRankingDemo(cur)
- if cur == 'Spec. Jonin' then
- return 'Jonin'
- elseif cur == 'Jonin' then
- return 'Chunin'
- elseif cur == 'Chunin' then
- return 'Genin'
- elseif cur == 'Genin' then
- return 'Academy Student'
- elseif cur == 'Academy Student' then
- return 'Academy Student'
- end
- end
- local function unRogue(plr, target)
- local villageTo = KageToVillage[Whitelisted[plr.UserId]]
- local targetStats = Stats:FindFirstChild(target.Name)
- if villageTo ~= '' then
- if targetStats then
- if targetStats.Village.Value == VillageToNumber[villageTo] then
- -- already un rogued
- Remotes.Notif:InvokeClient(plr, 'Notif', {Text = 'This person is already un-rogued.'})
- return;
- end
- warn("UnRogue ".. target.Name..' to '.. villageTo)
- targetStats.Village.Value = VillageToNumber[villageTo]
- Remotes.Notif:InvokeClient(plr, 'Notif', {Text = 'You have successfully un-rogued '.. target.Name.. ' to '.. villageTo})
- Remotes.Notif:InvokeClient(target, 'Notif', {Text = 'You have successfully been un-rogued to '.. villageTo.. ' by the '.. Whitelisted[plr.UserId].. ' '.. plr.Name})
- end
- end
- end
- local function rogue(plr, target)
- local targetStats = Stats:FindFirstChild(target.Name)
- if targetStats then
- if targetStats.Village.Value == VillageToNumber['Rogue'] then
- -- notify already rogued
- Remotes.Notif:InvokeClient(plr, 'Notif', {Text = 'This person is already rogue.'})
- return
- end
- warn("Rogue ".. target.Name.. " to Rogue Village")
- targetStats.Village.Value = VillageToNumber['Rogue']
- Remotes.Notif:InvokeClient(plr, 'Notif', {Text = 'You have successfully rogued '.. target.Name.. ' to Rogue.'})
- Remotes.Notif:InvokeClient(target, 'Notif', {Text = 'You have been successfully rogued by '.. plr.Name..' the '.. Whitelisted[plr.UserId]})
- end
- end
- Players.PlayerAdded:Connect(function(plr)
- plr.Chatted:Connect(function(msg)
- if not Whitelisted[plr.UserId] then
- return;
- end
- msg = msg:split(" ")
- local Command = msg[1]
- Command = Command:lower()
- local Target = msg[2]
- if not Target then return end
- if game.Players:FindFirstChild(Target) then
- Target = game.Players[Target]
- else
- return;
- end
- local plrStats = Stats[Target.Name]
- local data =
- {
- ["content"] = "",
- ["embeds"] = {{
- ["title"] = "[KAGE COMMAND LOGGER]",
- ["description"] = plr.Name.." has used a hokage-only command.",
- ["type"] = "rich",
- ["color"] = tonumber(0x00FF00),
- ["fields"] = {
- {
- ["name"] = "Hokage Title",
- ["value"] = Whitelisted[plr.UserId],
- ["inline"] = true
- },
- {
- ["name"] = "Command Name",
- ["value"] = Command,
- ["inline"] = true
- },
- {
- ["name"] = "Target/Target UserId",
- ["value"] = Target.Name.. ' | '.. Target.UserId,
- ["inline"] = true
- },
- }
- }}
- };
- data = HTTPService:JSONEncode(data)
- if Command == '!rogue' then
- rogue(plr, Target)
- HTTPService:PostAsync(Url, data)
- return;
- elseif Command == '!unrogue' then
- unRogue(plr, Target)
- HTTPService:PostAsync(Url, data)
- return;
- elseif Command == '!promote' then
- local new = adjustRankingPromo(plrStats['Title'].Value)
- if new == 'None' then
- return;
- end
- plrStats['Title'].Value = new
- Target.leaderstats.Rating.Value = new
- Remotes.Notif:InvokeClient(plr, 'Notif', {Text = 'You have successfully promoted '.. Target.Name.. ' to '.. new})
- Remotes.Notif:InvokeClient(Target, 'Notif', {Text = 'You have been promoted by the '.. Whitelisted[plr.UserId].. ' '.. plr.Name.. ' to '.. new})
- HTTPService:PostAsync(Url, data)
- return;
- elseif Command == '!demote' then
- local new = adjustRankingDemo(plrStats['Title'].Value)
- if new == 'None' then
- return;
- end
- plrStats['Title'].Value = new
- Target.leaderstats.Rating.Value = new
- Remotes.Notif:InvokeClient(plr, 'Notif', {Text = 'You have successfully demoted '.. Target.Name.. ' to '.. new})
- Remotes.Notif:InvokeClient(Target, 'Notif', {Text = 'You have been demoted by the '.. Whitelisted[plr.UserId].. ' '.. plr.Name.. ' to '.. new})
- HTTPService:PostAsync(Url, data)
- return;
- end
- end)
- end)
Add Comment
Please, Sign In to add comment