Advertisement
InTesting

Functions test

Feb 12th, 2019
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.48 KB | None | 0 0
  1. --[[ Copy and Paste functions and execute them with correct arguements.
  2.      If a specific function won't work. Tell me so I can fix it.
  3. --]]
  4.  
  5. function SetWalkSpeedTo(Target,WSNum)
  6.     if WSNum=="inf" or WSNum==math.huge then
  7.         print("Too huge.")
  8.     elseif typeof(WSNum)=="number" then
  9.         if game.Players:FindFirstChild(Target) then
  10.             if Target.Character:FindFirstChildWhichIsA("Humanoid") then
  11.                 Target.Character:FindFirstChildWhichIsA("Humanoid").WalkSpeed= WSNum
  12.            else
  13.                 print(Target.."'s humanoid is missing.")
  14.             end
  15.         else
  16.             print(Target.." does not exist or is not a string.")
  17.         end
  18.         print(WSNum.." is not a valid arguement. It needs to be a number.")
  19.     end
  20. end
  21.  
  22. function SetJumpPowerTo(Target,JPNum)
  23.     if JPNum=="inf" or JPNum==math.huge then
  24.         print("JPNum is too huge.")
  25.     elseif typeof(JPNum)=="number" then
  26.         if game.Players:FindFirstChild(Target) then
  27.             if Target.Character:FindFirstChildWhichIsA("Humanoid") then
  28.                 Target.Character:FindFirstChildWhichIsA("Humanoid").JumpPower= JPNum
  29.             else
  30.                 print(Target.."'s humanoid is missing.")
  31.             end
  32.         else
  33.             print(Target.." does not exist or is not a string.")
  34.         end
  35.         print(JPNum.." is not a valid arguement. It needs to be a number")
  36.     end
  37. end
  38.  
  39. function SetMaxHealthTo(Target,MHNum,bool_refillHealth)
  40.     if typeof(bool_refillHealth)~="boolean" then
  41.         print(bool_refillHealth.." is not a valid arguement. It needs to be a boolean.")
  42.     else
  43.        if typeof(MHNum)~="number" then
  44.             print(MHNum.." is not a valid arguement. It needs to be a number.")
  45.        else
  46.            if game.Players:FindFirstChild(Target)==nil then
  47.                print(Target.." does not exist.")
  48.             else
  49.                 if Target:FindFirstChildWhichIsA("Humanoid")==nil then
  50.                     print(Target.." does not have humanoid.")
  51.                 else
  52.                     Target:FindFirstChildWhichIsA("Humanoid").MaxHealth = MHNum
  53.                     if bool_refillHealth==true then
  54.                         Target:FindFirstChildWhichIsA("Humanoid").Health = MHNum
  55.                     end
  56.                 end
  57.             end
  58.         end
  59.     end
  60. end
  61.  
  62. function SetHealthTo(Target,HNum)
  63.     if typeof(HNum)~="number" then
  64.         print(HNum.." is not a valid arguement. It needs to be a number")
  65.     else
  66.         if game.Players:FindFirstChild(Target) == nil then
  67.             print("Can not find"..Target..".")
  68.         else
  69.             local h=Target:FindFirstChildWhichIsA("Humanoid")
  70.             if h==nil then
  71.                 print(Target.."'s humanoid does not exist.")
  72.             else
  73.                 h.Health=HNum
  74.             end
  75.         end
  76.     end
  77. end
  78.  
  79. function SetPlatformStand(Target,bool_stun)
  80.     if typeof(bool_stun)~="boolean" the
  81.         print(bool_stun.." is not a valid arguement. It needs to be a boolean")
  82.     else
  83.         if game.Players:FindFirstChild(Target)==nil then
  84.             print(Target.." does not exist.")
  85.         else
  86.             if Target:FindFirstChildWhichIsA("Humanoid") == nil then
  87.                 print(Target.."'s humanoid does not exist.")
  88.             else
  89.                 Target:FindFirstChildWhichIsA("Humanoid").PlatformStand = bool_stun
  90.             end
  91.         end
  92.     end
  93. end
  94.  
  95. function SetSitProperty(Target,bool_sit)
  96.     if typeof(bool_sit)~="boolean" the
  97.         print(bool_sit.." is not a valid arguement. It needs to be a boolean")
  98.     else
  99.         if game.Players:FindFirstChild(Target)==nil then
  100.             print(Target.." does not exist.")
  101.         else
  102.             if Target:FindFirstChildWhichIsA("Humanoid") == nil then
  103.                 print(Target.."'s humanoid does not exist.")
  104.             else
  105.                 Target:FindFirstChildWhichIsA("Humanoid").Sit = bool_sit
  106.             end
  107.         end
  108.     end
  109. end
  110.  
  111. function WeldifyParts(part1,part2)
  112.     local weldc = Instance.new("WeldConstraint",part1)
  113.     weldc.Part0 = part1
  114.     weldc.Part1 = part2
  115. end
  116.  
  117. function ChangeShirtTo(person,sId)
  118.         if game.Players:FindFirstChild(person)==nil then
  119.             print(person.."does not exist.")
  120.         else
  121.             local char=game.Players:FindFirstChild(person).Character
  122.             if typeof(sId)~="number" then
  123.                 print(sId.." is not a valid arguement. It needs to be a number value from an asset Id.")
  124.             else
  125.                 if char:FindFirstChildOfClass("Shirt") then
  126.                     char:FindFirstChildOfClass("Shirt").ShirtTemplate=sId
  127.                 else
  128.                     local nsh=Instance.new("Shirt",char)
  129.                     nsh.ShirtTemplate=sId
  130.                 end
  131.             end
  132.         end
  133.     end
  134.  
  135. function ChangePantsTo(person,pId)
  136.         if game.Players:FindFirstChild(person)==nil then
  137.             print(person.."does not exist.")
  138.         else
  139.             local char=game.Players:FindFirstChild(person).Character
  140.             if typeof(pId)~="number" then
  141.                 print(pId.." is not a valid arguement. It needs to be a number from an asset Id.")
  142.             else
  143.                 if char:FindFirstChildOfClass("Pants") then
  144.                     char:FindFirstChildOfClass("Pants").PantsTemplate =pId
  145.                 else
  146.                     local nsh=Instance.new("Pants",char)
  147.                     nsh.PantsTemplate=pId
  148.                 end
  149.             end
  150.         end
  151.     end
  152.  
  153. -- Fix functions. w/ clothing
  154.  
  155. function ChangeTShirtTo(person,sId)
  156.     if game.Players:FindFirstChild(person)==nil then
  157.         print(person..”does not exist.)
  158.     else
  159.         local char=game.Players:FindFirstChild(person).Character
  160.         if typeof(sId)~=“number” then
  161.             print(sId..” is not a valid arguement. It needs to be a number from an asset Id.)
  162.         else
  163.             if char:FindFirstChildOfClass(“ShirtGraphic”) then
  164.                 char:FindFirstChildOfClass(“ShirtGraphic”).ShirtTemplate =sId
  165.             else
  166.                 local nsh=Instance.new(“ShirtGraphic”,char)
  167.                 nsh.ShirtTemplate=sId
  168.             end
  169.         end
  170.     end
  171. end
  172.  
  173. function TeleportPlayerTo(player,PosV3)
  174.     if game.Players:FindFirstChild(player)==nil then
  175.         print(person..” does not exist”)
  176.     else
  177.         if typeof(PosV3)~=”vector3” then
  178.             print(PosV3.." is not a valid arguement. It needs to be a Vector3 value.")
  179.         else
  180.             local HRP = game.Players:FindFirstChild(player).Character:FindFirstChild("HumanoidRootPart")
  181.             if HRP then
  182.                 HRP.CFrame = CFrame.new(PosV3)
  183.             end
  184.         end
  185.     end
  186. end
  187.  
  188. function InvisibilityTargetPlayer(player,boolVal_IsInvisible)
  189.     local plyr = game.Players:FindFirstChild(player)
  190.     if plyr==nil then
  191.         print(player.." does not exist.")
  192.     else
  193.         local char = plyr.Character
  194.         if typeof(boolVal_IsInvisible)~="boolean" then
  195.             print(boolVal_IsInvisible.." is not a valid arguement. It needs to be a boolean value.")
  196.         else
  197.             charchildren = char:GetDescendants()
  198.             if boolVal_IsInvisible==true then
  199.                 for _, v in pairs(charchildren) do
  200.                     if v:IsA("MeshPart") or v:IsA("Part") then
  201.                         if v.Name~="HumanoidRootPart" then
  202.                             v.Transparency = 1
  203.                         end
  204.                     end
  205.                 end
  206.             else
  207.                 for _, v in pairs(charchildren) do
  208.                     if v:IsA("MeshPart") or v:IsA("Part") then
  209.                         if v.Name~="HumanoidRootPart" then
  210.                             v.Transparency = 0
  211.                         end
  212.                     end
  213.                 end
  214.             end
  215.         end
  216.     end
  217. end
  218.  
  219. function ControlPlayerControl(player,bool_control)
  220.     local plyr = game.Players:FindFirstChild(player)
  221.     if plyr then
  222.         if bool_control==true then
  223.             plyr.DevComputerMovementMode = Enum.DevComputerMovementMode.Scriptable
  224.             plyr.DevTouchMovementMode = Enum.DevTouchMovementMode.Scriptable
  225.         else
  226.             plyr.DevComputerMovementMode = Enum.DevComputerMovementMode.UserChoice
  227.             plyr.DevTouchMovementMode = Enum.DevTouchMovementMode.UserChoice
  228.         end
  229.     end
  230. end
  231.  
  232. function ChangeFaceInto(PlayerName,FaceId) -- Error
  233.     local TargetPlayer =game.Players:FindFirstChild(PlayerName)
  234.     if TargetPlayer==nil then
  235.         print(PlayerName..” is not a valid argument. PlayerName needs to be a string and needs to exist as a player.)
  236.     else
  237.         if typeof(FaceId)~=”number” then
  238.             print(FaceId..” is not a valid argument. FaceId needs to be a number value.)
  239.         else
  240.             local character = TargetPlayer.Character
  241.             character.Head.face.DecalId = FaceId
  242.         end
  243.     end
  244. end
  245.  
  246. -- Everything below this message is in testing.
  247.  
  248. function GiveSweaterTo(PlayerName,BrickColorName)
  249.     if game.Players:FindFirstChild(PlayerName)==nil then
  250.         print(PlayerName..” is not a valid argument. PlayerName needs to be a string and needs to exist as a player.)
  251.     else
  252.         if typeof(BrickColorName)~= string then
  253.             print(BrickColorName..” is not a valid argument. BrickColorName needs to be a string and a valid BrickColor name.)
  254.         else
  255.             local char = game.Players:FindFirstChild(PlayerName).Character
  256.             local bcolor = BrickColorName
  257.             function weldi(part1,part2)
  258.                 local weld0 =   Instance.new("WeldConstraint",part1)
  259.                 weld0.Part0 = part1
  260.                 weld0.Part1 = part2
  261.             end
  262.             if char then
  263.                 wait(1)
  264.                 local CCC = char:GetChildren()
  265.                 TorsoIsTrue = "Part"
  266.                 TorsoID = nil
  267.                 for _, v in pairs(CCC) do
  268.                     if v:IsA("CharacterMesh") then
  269.                         if v.MeshId==48112070 then
  270.                             TorsoIsTrue = "FE"
  271.                             TorsoID = v.MeshId     
  272.                         end
  273.                     end
  274.                 end
  275.                 if TorsoIsTrue=="FE" then
  276.                     local part_1 = Instance.new("Part",char)
  277.                     part_1.CFrame = char.Torso.CFrame* CFrame.new(0,.75,0)
  278.                     part_1.CanCollide = false
  279.                     weldi(char.Torso,part_1)
  280.                     part_1.BrickColor = BrickColor.new(bcolor)
  281.                     part_1.Material = Enum.Material.Fabric
  282.                     part_1.Size = Vector3.new(2.05,.55,1.05)
  283.        
  284.                     local part_2 = Instance.new("WedgePart",char)
  285.                     part_2.CFrame = char.Torso.CFrame* CFrame.new(-.771,-.25,0)
  286.                     part_2.Orientation =char.Torso.Orientation + Vector3.new(90,0,90)
  287.                     part_2.CanCollide = false
  288.                     weldi(char.Torso,part_2)
  289.                     part_2.BrickColor = BrickColor.new(bcolor)
  290.                     part_2.Material = Enum.Material.Fabric
  291.                     part_2.Size = Vector3.new(1, 0.55, 1.65)
  292.        
  293.                     local part_3 = Instance.new("WedgePart",char)
  294.                     part_3.CFrame = char.Torso.CFrame* CFrame.new(-.75,-.25,0)
  295.                     part_3.Orientation =char.Torso.Orientation + Vector3.new(-90,0,90)
  296.                     part_3.CanCollide = false
  297.                     weldi(char.Torso,part_3)
  298.                     part_3.BrickColor = BrickColor.new(bcolor)
  299.                     part_3.Material = Enum.Material.Fabric
  300.                     part_3.Size = Vector3.new(1, 0.55, 1.65)
  301.        
  302.                     local part_4 = Instance.new("WedgePart",char)
  303.                     part_4.CFrame = char.Torso.CFrame* CFrame.new(.75,-.25,0)
  304.                     part_4.Orientation =char.Torso.Orientation + Vector3.new(-90,180,90)
  305.                     part_4.CanCollide = false
  306.                     weldi(char.Torso,part_4)
  307.                     part_4.BrickColor = BrickColor.new(bcolor)
  308.                     part_4.Material = Enum.Material.Fabric
  309.                     part_4.Size = Vector3.new(1, 0.55, 1.65)
  310.        
  311.                     local part_5 = Instance.new("WedgePart",char)
  312.                     part_5.CFrame = char.Torso.CFrame* CFrame.new(.77,-.25,0)
  313.                     part_5.Orientation =char.Torso.Orientation + Vector3.new(90,180,90)
  314.                     part_5.CanCollide = false
  315.                     weldi(char.Torso,part_5)
  316.                     part_5.BrickColor = BrickColor.new(bcolor )
  317.                     part_5.Material = Enum.Material.Fabric
  318.                     part_5.Size = Vector3.new(1, 0.55, 1.65)
  319.        
  320.                     local part_6 = Instance.new("Part",char)
  321.                     part_6.CFrame = char.Torso.CFrame* CFrame.new(0,-.25,0)
  322.                     part_6.CanCollide = false
  323.                     weldi(char.Torso,part_6)
  324.                     part_6.BrickColor = BrickColor.new(bcolor )
  325.                     part_6.Material = Enum.Material.Fabric
  326.                     part_6.Size = Vector3.new(1, 1.6, 1)
  327.                 else
  328.                     local part1 = Instance.new("Part",char)
  329.                     part1.CFrame = char.Torso.CFrame
  330.                     part1.CanCollide = false
  331.                     weldi(char.Torso,part1)
  332.                     part1.BrickColor = BrickColor.new(bcolor )
  333.                     part1.Material = Enum.Material.Fabric
  334.                     part1.Size = Vector3.new(char.Torso.Size.X*1.05,char.Torso.Size.Y*1.05,char.Torso.Size.Z*1.05)
  335.                 end
  336.    
  337.                 part2 = Instance.new("Part",char)
  338.                 part2.CFrame = char["Left Arm"].CFrame *CFrame.new(0,.1,0)
  339.                 part2.CanCollide = false
  340.                 weldi(char["Left Arm"],part2)
  341.                 part2.BrickColor = BrickColor.new(bcolor )
  342.                 part2.Material = Enum.Material.Fabric
  343.                 part2.Size = Vector3.new(char["Left Arm"].Size.X*1.05,char["Left Arm"].Size.Y*.95,char["Left Arm"].Size.Z*1.05)
  344.  
  345.                 local bi = Instance.new("SurfaceGui",part2)
  346.                 bi.Face = "Back"
  347.                 local TL = Instance.new("TextLabel",bi)
  348.                 TL.Size = UDim2.new(1,0,.25,0)
  349.                 TL.Text = "CHL was here"
  350.                 TL.Font = Enum.Font.Code
  351.                 TL.BackgroundTransparency = 1
  352.                 TL.TextColor3 = Color3.fromRGB(255, 255, 255)
  353.                 TL.TextSize = 50
  354.  
  355.                 part3 = Instance.new("Part",char)
  356.                 part3.CFrame = char["Right Arm"].CFrame*CFrame.new(0,.1,0)
  357.                 part3.CanCollide = false
  358.                 weldi(char["Right Arm"],part3)
  359.                 part3.BrickColor = BrickColor.new(bcolor )
  360.                 part3.Material = Enum.Material.Fabric
  361.                 part3.Size = Vector3.new(char["Right Arm"].Size.X*1.05,char["Right Arm"].Size.Y*.95,char["Right Arm"].Size.Z*1.05)
  362.             end
  363.         end
  364.     end
  365. end
  366.  
  367. function GetTargetPantsId(TargetModel)
  368.     if TargetModel:FindFirstChildWhichIsA(“Pants”)==nil then
  369.         print(“No pants on model.)
  370.     else
  371.         print(TargetModel:FindFirstChildWhichIsA(“Pants”).PantsTemplate)
  372.     end
  373. end
  374.  
  375. function GetTargetShirtId(TargetModel)
  376.     if TargetModel:FindFirstChildWhichIsA(“Shirt”)==nil then
  377.         print(“No shirt on model.)
  378.     else
  379.         print(TargetModel:FindFirstChildWhichIsA(“Shirt”).ShirtTemplate)
  380.     end
  381. end
  382.  
  383. function ClearModules()
  384.     wait(1)
  385.     local GC = game:GetDescendants()
  386.     for _, v in pairs(GC) do
  387.         if v:IsA(“ModuleScript”) then
  388.             v:Destroy()
  389.         end
  390.     end
  391. end
  392.  
  393. function DeathEffect_Anchored1(TargetPlayer)
  394.     if game.Players:FindFirstChild(TargetPlayer)==nil then
  395.         print(TargetPlayer..” is not a valid argument. TargetPlayer needs to be a string and needs to exist as a player.)
  396.     else
  397.         local character = game.Players:FindFirstChild(TargetPlayer).Character
  398.         if character.Health>=0 then
  399.             print(TargetPlayer..” is not dead. No death effect executed.)
  400.         else
  401.             local CCC = character:GetDescendants()
  402.             for _, v in pairs(CCC) do
  403.                 if v:IsA(“MeshPart”) or v:IsA(“Part”) then
  404.                     v.Anchored = true
  405.                 end
  406.             end
  407.         end
  408.     end
  409. end
  410.  
  411. function DeathEffect_BrickColor1(TargetPlayer,BrickColorValue)
  412.     if game.Players:FindFirstChild(TargetPlayer)==nil then
  413.         print(TargetPlayer..” is not a valid argument. TargetPlayer needs to be a string and needs to exist as a player.)
  414.     else
  415.         if typeof(BrickColorValue)~=stringthen
  416.             print(BrickColorValue..” is not a valid argument. BrickColorValue needs to be a string and a valid brickcolor value.)
  417.         else
  418.             local character = game.Players:FindFirstChild(TargetPlayer).Character
  419.             if character.Health>=0 then
  420.                 print(TargetPlayer..” is not dead. No death effect executed.)
  421.             else
  422.                 local CCC = character:GetDescendants()
  423.                 for _, v in pairs(CCC) do
  424.                     if v:IsA(“MeshPart”) or v:IsA(“Part”) then
  425.                         v.BrickColor = BrickColor.new(BrickColorValue)
  426.                     end
  427.                 end
  428.             end
  429.         end
  430.     end
  431. end
  432.  
  433. function DeathEffect_DestroyAvatar(TargetPlayer)
  434. if game.Players:FindFirstChild(TargetPlayer)==nil then
  435.         print(TargetPlayer..” is not a valid argument. TargetPlayer needs to be a string and needs to exist as a player.)
  436.     else
  437.         local CCC = game.Players:FindFirstChild(TargetPlayer).Character:GetDescendants()
  438.         if game.Players:FindFirstChild(TargetPlayer).Character.Humanoid.Health>=0 then
  439.         print(“Player is not dead.)
  440.         else
  441.             for _, v in pairs(CCC) do
  442.                 if v:IsA(“MeshPart”) or v:IsA(“Part”) then
  443.                     v:Destroy()
  444.                 end
  445.             end
  446.         end
  447.     end
  448. end
  449.  
  450. function DeathEffect_Noobify(TargetPlayer)
  451.     if game.Players:FindFirstChild(TargetPlayer)==nil then
  452.         print(TargetPlayer..” is not a valid argument. TargetPlayer needs to be a string and needs to exist as a player.)
  453.     else
  454.         local TargetAvat = game.Players:FindFirstChild(TargetPlayer).Character
  455.         local boC = TargetAvat:FindFirstChildWhichIsA(“BodyColors”)
  456.         local hum=TargetAvat:FindFirstChildWhichIsA(“Humanoid”)
  457.         if boC==nil then
  458.             print(“Can not find body colors.)
  459.         else
  460.             if hum==nil then
  461.                 print(“Can not find humanoid.)
  462.             else
  463.                 if hum.Health>=0 then
  464.                     print(“Player is not dead.)
  465.                 else
  466.                     boC.HeadColor = BrickColor.new(“New Yeller”)
  467.                     boC.TorsoColor = BrickColor.new(“Really blue”)
  468.                     boC.LeftArmColor = BrickColor.new(“New Yeller”)
  469.                     boC.RightArmColor = BrickColor.new(“New Yeller”)
  470.                     boC.LeftLegColor = BrickColor.new(“Bright green”)
  471.                     boC.RightLegColor = BrickColor.new(“Bright green”)
  472.                 end
  473.             end
  474.         end
  475.     end
  476. end
  477.  
  478. function LoadAccessory(person,AssetID)
  479.     local accessory = game:GetService("InsertService"):LoadAsset(AssetID):GetChildren()[1]
  480.     accessory.Parent = game:GetService("Players"):FindFirstChild(person).Character
  481. end
  482.  
  483. function SC_ChatBarDisabled(bool_EnableChatBat) -- LocalScript
  484.     local StarterGui = game:GetService("StarterGui")
  485.     if StarterGui then
  486.         StarterGui:SetCore("ChatBarDisabled",bool_EnableChatBat)
  487.     end
  488. end
  489.  
  490. function SC_SendNotification(table_NotificationProperties) -- LocalScript
  491.     local StarterGui = game:GetService("StarterGui")
  492.     if StarterGui then
  493.         StarterGui:SetCore("SendNotification",table_NotificationProperties)
  494.     end
  495. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement