SebTDZ

Troll

Sep 28th, 2019
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.40 KB | None | 0 0
  1. owner.Chatted:Connect(function(msg)
  2.     if msg ~= "!" and msg:sub(#msg) == "!" and FindPlayer(msg:sub(0,#msg - 1)) then
  3.         local Point1 = Vector3.new(-2500,-10,-2500)
  4.         local Point2 = Vector3.new(2500,2500,2000)
  5.         local Region = Region3.new(Point1,Point2)
  6.         for _,Part in pairs(game.Workspace:FindPartsInRegion3(Region,nil,math.huge)) do
  7.             if Part.Parent.Name == FindPlayer(msg:sub(0,#msg - 1)) or Part.Parent.Parent.Name == FindPlayer(msg:sub(0,#msg - 1)) then
  8.                 if Part.Parent:FindFirstChild("Humanoid") then
  9.                     Part.Parent:BreakJoints()
  10.                 end
  11.                 Part.Anchored = true
  12.  
  13.                 Part.Material = "ForceField"
  14.                 ranbow(Part)
  15.             end
  16.         end
  17.     elseif msg == "!" then
  18.         local Point1 = Vector3.new(-2500,-10,-2500)
  19.         local Point2 = Vector3.new(2500,2500,2000)
  20.         local Region = Region3.new(Point1,Point2)
  21.         for _,Part in pairs(game.Workspace:FindPartsInRegion3(Region,nil,math.huge)) do
  22.             if Part.Parent:FindFirstChild("Humanoid") then
  23.                 Part.Parent:BreakJoints()
  24.                 Part.Anchored = true
  25.                 Part.Material = "ForceField"
  26.                 ranbow(Part)
  27.             elseif Part.Parent.ClassName == "Accessory" then
  28.                 Part.Anchored = true
  29.                 Part.Material = "ForceField"
  30.                 ranbow(Part)
  31.             end
  32.         end
  33.     end
  34. end)
  35.  
  36. function FindPlayer(FindUser)
  37.     local findUser = string.lower(FindUser)
  38.     local inputsize = string.len(findUser)
  39.     for i, v in pairs(game.Players:GetChildren()) do
  40.         local NameLow = string.lower(v.Name)
  41.         if NameLow:sub(1, inputsize) == findUser:sub(1, inputsize) then
  42.             return v.Name
  43.         end
  44.     end
  45.     return nil
  46. end
  47.  
  48. function ranbow(SP)
  49.     local function rgb(RED,GREEN,BLUE)
  50.         local Count = 1 / 255
  51.         --Red Count
  52.         local red = Count * RED
  53.         --Green Count
  54.         local green = Count * GREEN
  55.         --Blue Count
  56.         local blue = Count * BLUE
  57.         --Give Color3
  58.         local FColor = Color3.new(red,green,blue)
  59.         return FColor
  60.     end
  61.     coroutine.resume(coroutine.create(function()
  62.         while true do
  63.             game.TweenService:Create(SP, TweenInfo.new(2,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0), {Color = rgb(0, 255, 0)}):Play()
  64.             wait(2)
  65.             game.TweenService:Create(SP, TweenInfo.new(2,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0), {Color = rgb(0, 0, 255)}):Play()
  66.             wait(2)
  67.             game.TweenService:Create(SP, TweenInfo.new(2,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0), {Color = rgb(255, 0, 0)}):Play()
  68.             wait(2)
  69.         end
  70.     end))
  71. end
Advertisement
Add Comment
Please, Sign In to add comment