Advertisement
Sungmingamerpro13

Roles System

Oct 16th, 2023 (edited)
823
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 4.95 KB | Source Code | 0 0
  1. local RolesEvent = game.ReplicatedStorage.RolesEvent
  2.  
  3. RolesEvent.NormalKid.OnServerEvent:Connect(function(player)
  4.     player:WaitForChild("Role").Value = "Normal Kid"
  5.     player.Character.Humanoid.MaxHealth = 100
  6.     player.Character.Humanoid.BodyDepthScale.Value = 0.7
  7.     player.Character.Humanoid.BodyHeightScale.Value = 0.7
  8.     player.Character.Humanoid.BodyWidthScale.Value = 0.6
  9.     if (player) and (player.Character) then
  10.         for _, Item in pairs(player.Character:GetChildren()) do
  11.             if Item:IsA("Tool") then
  12.                 Item:Destroy()
  13.             end
  14.         end
  15.     end
  16. end)
  17.  
  18. RolesEvent.Protector.OnServerEvent:Connect(function(player)
  19.     player:WaitForChild("Role").Value = "Protector 1"
  20.     player.Character.Humanoid.MaxHealth = 100
  21.     player.Character.Humanoid.BodyDepthScale.Value = 1
  22.     player.Character.Humanoid.BodyHeightScale.Value = 1
  23.     player.Character.Humanoid.BodyWidthScale.Value = 1
  24.     local Bat = game.ServerStorage.SavedTools.Bat
  25.     if (player) and (player.Character) then
  26.         for _, Item in pairs(player.Character:GetChildren()) do
  27.             if Item:IsA("Tool") then
  28.                 Item:Destroy()
  29.             end
  30.         end
  31.     end
  32.     Bat:Clone().Parent = player.Backpack
  33. end)
  34.  
  35. RolesEvent.Medic.OnServerEvent:Connect(function(player)
  36.     player:WaitForChild("Role").Value = "Medic"
  37.     player.Character.Humanoid.MaxHealth = 100
  38.     player.Character.Humanoid.BodyDepthScale.Value = 1
  39.     player.Character.Humanoid.BodyHeightScale.Value = 1
  40.     player.Character.Humanoid.BodyWidthScale.Value = 1
  41.     local Medkit = game.ServerStorage.SavedTools.Medkit
  42.     if (player) and (player.Character) then
  43.         for _, Item in pairs(player.Character:GetChildren()) do
  44.             if Item:IsA("Tool") then
  45.                 Item:Destroy()
  46.             end
  47.         end
  48.     end
  49.     Medkit:Clone().Parent = player.Backpack
  50. end)
  51.  
  52. RolesEvent.Flashlight_Protector.OnServerEvent:Connect(function(player)
  53.     player:WaitForChild("Role").Value = "Protector 2"
  54.     player.Character.Humanoid.MaxHealth = 100
  55.     player.Character.Humanoid.BodyDepthScale.Value = 1
  56.     player.Character.Humanoid.BodyHeightScale.Value = 1
  57.     player.Character.Humanoid.BodyWidthScale.Value = 1
  58.     local Flashlight = game.ServerStorage.SavedTools.Flashlight
  59.     local Bat = game.ServerStorage.SavedTools.Bat
  60.     if (player) and (player.Character) then
  61.         for _, Item in pairs(player.Character:GetChildren()) do
  62.             if Item:IsA("Tool") then
  63.                 Item:Destroy()
  64.             end
  65.         end
  66.     end
  67.     Bat:Clone().Parent = player.Backpack
  68.     Flashlight:Clone().Parent = player.Backpack
  69. end)
  70.  
  71. RolesEvent.IceCreamBoy.OnServerEvent:Connect(function(player)
  72.     player:WaitForChild("Role").Value = "IceCreamBoy"
  73.     player.Character.Humanoid.MaxHealth = 100
  74.     player.Character.Humanoid.BodyDepthScale.Value = 1
  75.     player.Character.Humanoid.BodyHeightScale.Value = 1
  76.     player.Character.Humanoid.BodyWidthScale.Value = 1
  77.     local IceCream = game.ServerStorage.SavedTools:FindFirstChild("Ice Cream")
  78.     if (player) and (player.Character) then
  79.         for _, Item in pairs(player.Character:GetChildren()) do
  80.             if Item:IsA("Tool") then
  81.                 Item:Destroy()
  82.             end
  83.         end
  84.     end
  85.     IceCream:Clone().Parent = player.Backpack
  86. end)
  87.  
  88. RolesEvent.Fighter.OnServerEvent:Connect(function(player)
  89.     player:WaitForChild("Role").Value = "Fighter"
  90.     player.Character.Humanoid.MaxHealth = 100
  91.     player.Character.Humanoid.BodyDepthScale.Value = 0.7
  92.     player.Character.Humanoid.BodyHeightScale.Value = 0.7
  93.     player.Character.Humanoid.BodyWidthScale.Value = 0.6
  94.     local WoodenSword = game.ServerStorage.SavedTools.WoodenSword
  95.     if (player) and (player.Character) then
  96.         for _, Item in pairs(player.Character:GetChildren()) do
  97.             if Item:IsA("Tool") then
  98.                 Item:Destroy()
  99.             end
  100.         end
  101.     end
  102.     WoodenSword:Clone().Parent = player.Backpack
  103. end)
  104.  
  105. RolesEvent.Super_Protector.OnServerEvent:Connect(function(player)
  106.     player:WaitForChild("Role").Value = "Protector 3"
  107.     if player.Role.Value == "Protector 3" then
  108.         player.Character.Humanoid.MaxHealth = 100
  109.         player.Character.Humanoid.BodyDepthScale.Value = 1
  110.         player.Character.Humanoid.BodyHeightScale.Value = 1
  111.         player.Character.Humanoid.BodyWidthScale.Value = 1
  112.         local Medkit = game.ServerStorage.SavedTools.Medkit
  113.         local Bat = game.ServerStorage.SavedTools.Bat
  114.         if (player) and (player.Character) then
  115.             for _, Item in pairs(player.Character:GetChildren()) do
  116.                 if Item:IsA("Tool") then
  117.                     Item:Destroy()
  118.                 end
  119.             end
  120.         end
  121.         Bat:Clone().Parent = player.Backpack
  122.         Medkit:Clone().Parent = player.Backpack
  123.     end
  124.     player:WaitForChild("Role").Value = "PREMIUM"
  125.     if player.Role.Value == "PREMIUM" then
  126.         player.Character.Humanoid.MaxHealth = 100
  127.         player.Character.Humanoid.BodyDepthScale.Value = 1
  128.         player.Character.Humanoid.BodyHeightScale.Value = 1
  129.         player.Character.Humanoid.BodyWidthScale.Value = 1
  130.         local Medkit = game.ServerStorage.SavedTools.Medkit
  131.         local Bat = game.ServerStorage.SavedTools.Bat
  132.         if (player) and (player.Character) then
  133.             for _, Item in pairs(player.Character:GetChildren()) do
  134.                 if Item:IsA("Tool") then
  135.                     Item:Destroy()
  136.                 end
  137.             end
  138.         end
  139.         Bat:Clone().Parent = player.Backpack
  140.         Medkit:Clone().Parent = player.Backpack
  141.     end
  142. end)
  143.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement