Amazingranma261

--

Jul 31st, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 15.81 KB | None | 0 0
  1. VERSION_ID = 1.0
  2. PROJECT_NAME = "Android"
  3. SERVER_SIDED = true
  4. AUTHOR = "amazingranma261"
  5. --
  6. android_scale = 2
  7.  
  8.  
  9. --Character Variables
  10. name = "MonoDev"
  11. player = game.Players:FindFirstChild(name)
  12. character = player.Character
  13. head = character:FindFirstChild("Head")
  14. head_mesh = head:FindFirstChild("Mesh")
  15. torso = character:FindFirstChild("Torso")
  16. humanoid_rootpart = character:FindFirstChild("HumanoidRootPart")
  17. left_arm = character:FindFirstChild("Left Arm")
  18. right_arm = character:FindFirstChild("Right Arm")
  19. left_leg = character:FindFirstChild("Left Leg")
  20. right_leg = character:FindFirstChild("Right Leg")
  21. humanoid = character:FindFirstChild("Humanoid")
  22. player_gui = player:FindFirstChild("PlayerGui")
  23.  
  24. -- Stat Variables
  25. max_health = 100*android_scale
  26. speed = 32
  27. max_damage = 10*android_scale
  28. invisble = false
  29. debounce = false
  30.  
  31.  
  32. -- Destroy Animation Objects and Accessories
  33. humanoid:FindFirstChild("Animator"):Destroy()
  34. character:FindFirstChild("Animate"):Destroy()
  35. --character:FindFirstChild("Shirt"):Destroy()
  36. head:FindFirstChild("face"):Destroy()
  37. character.Sound:Destroy()
  38. -- Setup Stats
  39. humanoid.MaxHealth = max_health
  40. humanoid.Health = max_health
  41. humanoid.WalkSpeed = speed
  42.  
  43. humanoid.JumpPower = 10/android_scale
  44.  
  45.  
  46.  
  47.  
  48. -- Accessories
  49. hair = Instance.new("Part", character)
  50. hair.CanCollide = false
  51. hair.Anchored = false
  52. hair_mesh = Instance.new("SpecialMesh",hair)
  53. hair_mesh.MeshType = "FileMesh"
  54. hair_mesh.MeshId = "http://www.roblox.com/asset/?id=76056263"
  55. hair_mesh.Scale = hair_mesh.Scale*android_scale
  56.    
  57. crown = Instance.new("Part", character)
  58. crown.CanCollide = false
  59. crown.Anchored = false
  60. crown_mesh = Instance.new("SpecialMesh",crown)
  61. crown_mesh.MeshType = "FileMesh"
  62. crown_mesh.MeshId = "http://www.roblox.com/asset/?id=1078075"
  63. crown_mesh.Scale = crown_mesh.Scale*android_scale  
  64.    
  65. mask = Instance.new("Part", character)
  66. mask.CanCollide = false
  67. mask.Anchored = false
  68. mask_mesh = Instance.new("SpecialMesh",mask)
  69. mask_mesh.MeshType = "FileMesh"
  70. mask_mesh.MeshId = "http://www.roblox.com/asset/?id=13521079"
  71. mask_mesh.Scale = mask_mesh.Scale*android_scale
  72. --[[
  73. theme = Instance.new("Sound",workspace)
  74. theme.MaxDistance = 200
  75. theme.MinDistance = 0
  76. theme.Volume = 7
  77. theme.EmitterSize = 30
  78. theme.PlaybackSpeed = 1
  79. theme.SoundId = "rbxassetid://1050802290"--191986587"
  80. ]]--
  81. --game:GetService("ContentProvider"):Preload(theme.SoundId)
  82.    
  83. -- Weld Character
  84. w0 = Instance.new("Weld", character)
  85. w1 = Instance.new("Weld", character)
  86. w2 = Instance.new("Weld", character)
  87. w3 = Instance.new("Weld", character)
  88. w4 = Instance.new("Weld",character)
  89. w5 = Instance.new("Weld", character)
  90. w6 = Instance.new("Weld", character)
  91. w7 = Instance.new("Weld", character)
  92. w8 = Instance.new("Weld", character)
  93.  
  94. function weldCharacter()
  95.     -- Head to Torso
  96.     w0.Part0 = torso
  97.     w0.Part1 = head
  98.     w0.C0 = CFrame.new((Vector3.new(0,1.5,0))*android_scale)
  99.     --cframe angles forward, twist, out
  100.     -- Left Arm to Torso
  101.     w1.Part0 = torso
  102.     w1.Part1 = left_arm
  103.     w1.C0 = CFrame.new((Vector3.new(-1.5,0,0))*android_scale)
  104.    
  105.     -- Right Arm to Torso
  106.     w2.Part0 = torso
  107.     w2.Part1 = right_arm
  108.     w2.C0 = CFrame.new((Vector3.new(1.5,0,0))*android_scale)
  109.    
  110.     -- Left Leg to Torso
  111.     w3.Part0 = torso
  112.     w3.Part1 = left_leg
  113.     w3.C0 = CFrame.new((Vector3.new(-.5,-2,0))*android_scale)
  114.    
  115.     -- Right Leg to Torso
  116.     w4.Part0 = torso
  117.     w4.Part1 = right_leg
  118.     w4.C0 = CFrame.new((Vector3.new(.5,-2,0))*android_scale)
  119.    
  120.     -- Root Part to Torso
  121.     w5.Part0 = torso
  122.     w5.Part1 = humanoid_rootpart
  123.    
  124.     -- Hair to Head
  125.     w6.Part0 = head
  126.     w6.Part1 = hair
  127.     w6.C0 = CFrame.new((Vector3.new(-.1,0.2,.2))*android_scale)
  128.    
  129.     -- Crown to Head
  130.     w7.Part0 = head
  131.     w7.Part1 = crown
  132.     w7.C0 = CFrame.new((Vector3.new(0,.8,0))*android_scale)
  133.    
  134.     -- Mask to Head
  135.     w8.Part0 = head
  136.     w8.Part1 = mask
  137.     w8.C0 = CFrame.new((Vector3.new(0,0,-.5))*android_scale)
  138. end
  139.  
  140. function scaleCharacter()
  141.    
  142.     --Resize Character
  143.     torso.Size = torso.Size*android_scale
  144.     head.Size = head.Size*android_scale
  145.     humanoid_rootpart.Size = humanoid_rootpart.Size*android_scale
  146.     left_arm.Size = left_arm.Size*android_scale
  147.     right_arm.Size = right_arm.Size*android_scale
  148.     left_leg.Size = left_leg.Size*android_scale
  149.     right_leg.Size = right_leg.Size*android_scale
  150.    
  151.     -- Replace Joints
  152.     weldCharacter()
  153. end
  154.  
  155.  
  156. function colorizeCharacter()
  157.     torso.Color = Color3.fromRGB(200,200,200)
  158.     head.Color = Color3.fromRGB(180,200,225)
  159.     left_arm.Color = Color3.fromRGB(180,200,225)
  160.     left_leg.Color = Color3.fromRGB(200,200,200)
  161.     right_arm.Color = Color3.fromRGB(180,200,225)
  162.     right_leg.Color = Color3.fromRGB(200,200,200)
  163.     hair.Color = torso.Color
  164.     mask.Color = head.Color
  165. end
  166.  
  167. function turnInvisible() --play sound when turning invisible and uninvisble
  168.     if(not invisble) then
  169.         invisble = true
  170.         for i = 0,1.01,.01 do
  171.             wait()
  172.             head.Transparency = i  
  173.             torso.Transparency = i 
  174.             left_arm.Transparency = i  
  175.             left_leg.Transparency = i
  176.             right_arm.Transparency = i 
  177.             right_leg.Transparency = i
  178.             mask.Transparency = i  
  179.             crown.Transparency = i
  180.             hair.Transparency = i
  181.         end
  182.     end
  183. end
  184.  
  185. function turnUninvisible() --play sound when turning invisible and uninvisble
  186.     if(invisble) then
  187.         invisble = false
  188.         for i = 1,-.01,-.01 do
  189.             wait()
  190.             head.Transparency = i  
  191.             torso.Transparency = i 
  192.             left_arm.Transparency = i  
  193.             left_leg.Transparency = i
  194.             right_arm.Transparency = i 
  195.             right_leg.Transparency = i
  196.             mask.Transparency = i  
  197.             crown.Transparency = i
  198.             hair.Transparency = i
  199.         end
  200.     end
  201. end
  202.  
  203. function resetCFrame()
  204.     -- Head
  205.     w0.C0 = CFrame.new((Vector3.new(0,1.5,0))*android_scale)
  206.    
  207.     -- Left Arm
  208.     w1.C0 = CFrame.new((Vector3.new(-1.5,0,0))*android_scale)
  209.      
  210.     -- Right Arm
  211.     w2.C0 = CFrame.new((Vector3.new(1.5,0,0))*android_scale)
  212.    
  213.     -- Left Leg
  214.     w3.C0 = CFrame.new((Vector3.new(-.5,-2,0))*android_scale)
  215.    
  216.     -- Right Leg
  217.     w4.C0 = CFrame.new((Vector3.new(.5,-2,0))*android_scale)
  218.    
  219.     -- Hair
  220.     w6.C0 = CFrame.new((Vector3.new(-.1,0.2,.2))*android_scale)
  221.    
  222.     -- Crown
  223.     w7.C0 = CFrame.new((Vector3.new(0,.8,0))*android_scale)
  224.    
  225.     -- Mask 0,0,-3
  226.     w8.C0 = CFrame.new((Vector3.new(0,0,-.5))*android_scale)
  227. end
  228.  
  229. function getNearbyPlayersAndObjects(reach)
  230.     local items= {}
  231.     for _,v in pairs(game.Players:GetPlayers()) do
  232.         local c = v.Character
  233.         local head = v.Character:FindFirstChild("Head")
  234.         if(head)then
  235.             local distance = player:DistanceFromCharacter(head.Position)
  236.             if( distance <= reach and distance > 1 ) then
  237.                     table.insert(items, v)
  238.             end
  239.         end
  240.     end
  241.    
  242.     for _,v in pairs(workspace:GetChildren()) do
  243.         if(v.ClassName == "Part" and v.Anchored == false) then
  244.             table.insert(items,v)
  245.         end
  246.     end
  247.     return items
  248. end
  249.  
  250. function hurt(hit, max)
  251.         if(hit.ClassName == "Part") then
  252.             hit = hit.Parent
  253.         end
  254.         local hum = hit:FindFirstChild("Humanoid")
  255.         if(hum and not hum.Parent.Name == name)then
  256.             if(max) then
  257.                 hum:TakeDamage(max_damage)
  258.             else
  259.                 hum:TakeDamage(math.random(max_damage))
  260.             end
  261.         end
  262. end
  263.  
  264. function main()
  265.     scaleCharacter()
  266.     colorizeCharacter()
  267.     --theme:Play()
  268.     coroutine.resume(animation_thread) 
  269.     --Gui
  270.     local screen_gui = Instance.new("ScreenGui",player_gui)
  271.     local container  = Instance.new("Frame",screen_gui)
  272.     container.Size = UDim2.new(0.1,0,0.5,0)
  273.     container.Position = UDim2.new(0.89,0,0.2,0)
  274.     container.BackgroundTransparency = 1
  275.     --Invisible
  276.     local ability1_button = Instance.new("TextButton",container)
  277.     ability1_button.Size = UDim2.new(1,0,.2,0)
  278.     ability1_button.Position = UDim2.new(0,0,0,0)
  279.     ability1_button.Text = "Invisibility"
  280.     ability1_button.TextColor3 = Color3.fromRGB(255,255,255)
  281.     ability1_button.BackgroundColor3 = Color3.fromRGB(0,0,0)
  282.     ability1_button.BackgroundTransparency = .6
  283.     ability1_button.MouseButton1Click:connect(function()
  284.                 if(not invisble) then
  285.                 turnInvisible()
  286.             else
  287.                 turnUninvisible()
  288.             end
  289.     end)
  290.    
  291.     --Push
  292.     local ability2_button = Instance.new("TextButton",container)
  293.     ability2_button.Size = UDim2.new(1,0,.2,0)
  294.     ability2_button.Position = UDim2.new(0,0,0.2,0)
  295.     ability2_button.Text = "Push"
  296.     ability2_button.TextColor3 = Color3.fromRGB(255,255,255)
  297.     ability2_button.BackgroundColor3 = Color3.fromRGB(0,0,0)
  298.     ability2_button.BackgroundTransparency = .6
  299.     ability2_button.MouseButton1Click:connect(function()
  300.         local players = getNearbyPlayersAndObjects(100*android_scale)
  301.             if(players) then
  302.                 for _,v in pairs(players) do
  303.                     if(v.ClassName == "Player") then
  304.                         local c = v.Character
  305.                         local force = Instance.new("BodyForce",c:FindFirstChild("Head"))
  306.                         force.Force = (head.CFrame.lookVector)*20000
  307.                         c:FindFirstChild("Humanoid"):TakeDamage(max_damage)
  308.                     else
  309.                         local force = Instance.new("BodyForce",v)
  310.                         force.Force = (head.CFrame.lookVector)*20000
  311.                     end
  312.                 end
  313.                 wait(.5)
  314.                 for _,v in pairs(players) do
  315.                     if(v.ClassName == "Player" )then
  316.                         local force = v.Character:FindFirstChild("Head"):FindFirstChild("BodyForce")
  317.                         if(force)then                  
  318.                             force:Destroy()
  319.                         end
  320.                     else
  321.                         local force = v:FindFirstChild("BodyForce")
  322.                         if(force)then                  
  323.                             force:Destroy()
  324.                         end
  325.                     end
  326.                 end            
  327.             end
  328.     end)
  329.     --Pull
  330.     local ability3_button = Instance.new("TextButton",container)
  331.     ability3_button.Size = UDim2.new(1,0,.2,0)
  332.     ability3_button.Position = UDim2.new(0,0,0.4,0)
  333.     ability3_button.Text = "Pull"
  334.     ability3_button.TextColor3 = Color3.fromRGB(255,255,255)
  335.     ability3_button.BackgroundColor3 = Color3.fromRGB(0,0,0)
  336.     ability3_button.BackgroundTransparency = .6
  337.     ability3_button.MouseButton1Click:connect(function()
  338.         local players = getNearbyPlayersAndObjects(300*android_scale)
  339.             if(players) then
  340.                 for _,v in pairs(players) do
  341.                     if(v.ClassName == "Player") then
  342.                         local c = v.Character
  343.                         local force = Instance.new("BodyForce",c:FindFirstChild("Head"))
  344.                         force.Force = (head.CFrame.lookVector)*-20000
  345.                     else
  346.                         local force = Instance.new("BodyForce",v)
  347.                         force.Force = (head.CFrame.lookVector)*-20000
  348.                     end
  349.                 end
  350.                 wait(1)
  351.                 for _,v in pairs(players) do
  352.                     if(v.ClassName == "Player" )then
  353.                         local force = v.Character:FindFirstChild("Head"):FindFirstChild("BodyForce")
  354.                         if(force)then                  
  355.                             force:Destroy()
  356.                         end
  357.                     else
  358.                         local force = v:FindFirstChild("BodyForce")
  359.                         if(force)then                  
  360.                             force:Destroy()
  361.                         end
  362.                     end
  363.                 end            
  364.             end
  365.     end)
  366.     --Teleport
  367.     local ability4_button = Instance.new("TextButton",container)
  368.     ability4_button.Size = UDim2.new(1,0,.2,0)
  369.     ability4_button.Position = UDim2.new(0,0,0.6,0)
  370.     ability4_button.Text = "Teleport"
  371.     ability4_button.TextColor3 = Color3.fromRGB(255,255,255)
  372.     ability4_button.BackgroundColor3 = Color3.fromRGB(0,0,0)
  373.     ability4_button.BackgroundTransparency = .6
  374.     ability4_button.MouseButton1Click:connect(function()
  375.         character:SetPrimaryPartCFrame(torso.CFrame*(CFrame.new(head.CFrame.lookVector*100)))
  376.     end)
  377.     --Clone
  378.     local ability5_button = Instance.new("TextButton",container)
  379.     ability5_button.Size = UDim2.new(1,0,.2,0)
  380.     ability5_button.Position = UDim2.new(0,0,0.8,0)
  381.     ability5_button.Text = "Clone"
  382.     ability5_button.TextColor3 = Color3.fromRGB(255,255,255)
  383.     ability5_button.BackgroundColor3 = Color3.fromRGB(0,0,0)
  384.     ability5_button.BackgroundTransparency = .6
  385.     ability5_button.MouseButton1Click:connect(function()
  386.             character.Archivable = true
  387.             local clones = {}
  388.             coroutine.wrap(function()
  389.                 turnInvisible()
  390.             end)
  391.             for i = 1,30 do
  392.                 wait(.1)
  393.                 local clone = character:Clone()
  394.                 clone.Parent = workspace
  395.                 clone.PrimaryPart = clone.Torso
  396.                 clone.Humanoid:Destroy()
  397.                 clone.Torso.CanCollide = false
  398.                 clone.HumanoidRootPart:Destroy()
  399.                 clone.Head.CanCollide = false
  400.                 clone:SetPrimaryPartCFrame(torso.CFrame)
  401.                 clone.Torso.Anchored = true
  402.                 clone.Head.Anchored = true
  403.                 clone["Left Leg"].Anchored = true
  404.                 clone["Right Leg"].Anchored = true
  405.                 clone["Left Arm"].Anchored = true
  406.                 clone["Right Arm"].Anchored = true
  407.                 wait()
  408.                 clone.Torso.Color = torso.Color
  409.                 clone.Head.Color = head.Color
  410.                 clone["Left Leg"].Color = left_leg.Color
  411.                 clone["Right Leg"].Color = right_leg.Color
  412.                 clone["Left Arm"].Color = left_arm.Color
  413.                 clone["Right Arm"].Color = right_arm.Color
  414.                 table.insert(clones,clone)
  415.             end
  416.             wait(5)
  417.             for _,v in pairs(clones) do
  418.                 wait()
  419.                 v:Destroy()
  420.             end
  421.             character.Archivable = false
  422.     end)
  423.     --End Of Gui
  424.  
  425. end
  426.  
  427. function animation_handler()
  428.    
  429.     while(wait()) do
  430.        
  431.     if(isIdling) then
  432.         resetCFrame()
  433.         local w1_resting_pos = w1.C0  * CFrame.Angles(0,0,math.rad(-5)) +Vector3.new(0,0.05,0)*android_scale
  434.         local w1_upward_pos = w1.C0  * CFrame.Angles(0,0,math.rad(-10)) +Vector3.new(-.1,.1,0)*android_scale       
  435.         local w2_resting_pos = w2.C0 *CFrame.Angles(0,0,math.rad(5)) +Vector3.new(0,0.05,0)*android_scale
  436.         local w2_upward_pos = w2.C0 * CFrame.Angles(0,0,math.rad(10)) +Vector3.new(.1,.1,0)*android_scale
  437.         local w0_resting_pos = w0.C0
  438.         local w0_upward_pos = w0.C0 * CFrame.Angles(math.rad(10),0,0)
  439.         while(isIdling) do
  440.             for i = 0,1,.005 do
  441.                 if(not isIdling)then break end
  442.                 w1.C0 = w1_resting_pos:lerp(w1_upward_pos, i)
  443.                 if(not isIdling)then break end
  444.                 w2.C0 = w2_resting_pos:lerp(w2_upward_pos,i)
  445.                 w0.C0 = w0_resting_pos:lerp(w0_upward_pos,i)
  446.                 run_service.Heartbeat:wait()
  447.             end
  448.             if(not isIdling)then break end
  449.             if(not isIdling)then break end
  450.             for j = 0,1,.005 do
  451.                 if(not isIdling)then break end
  452.                 w1.C0 = w1_upward_pos:lerp(w1_resting_pos, j)
  453.                 w2.C0 = w2_upward_pos:lerp(w2_resting_pos,j)
  454.                 if(not isIdling)then break end
  455.                 w0.C0 = w0_upward_pos:lerp(w0_resting_pos,j)
  456.                 run_service.Heartbeat:wait()
  457.             end
  458.         end
  459.     end
  460.    
  461.     if(isWalking) then
  462.             resetCFrame()
  463.            
  464.             --left arm forward 
  465.             local left_arm_forward = w1.C0 * CFrame.Angles(math.rad(25),0,math.rad(-5)) + Vector3.new(-.05,0,-.4)*android_scale
  466.             --left arm backward
  467.             local left_arm_backward = w1.C0 * CFrame.Angles(math.rad(-25),0,math.rad(-5)) + Vector3.new(-.05,0,.4)*android_scale
  468.            
  469.             --right arm forward
  470.             local right_arm_forward = w2.C0 * CFrame.Angles(math.rad(25),0,math.rad(5)) + Vector3.new(.05,0,-.4)*android_scale
  471.             --right arm backward   
  472.             local right_arm_backward = w2.C0 * CFrame.Angles(math.rad(-25),0,math.rad(5)) + Vector3.new(.05,0,.4)*android_scale
  473.            
  474.             --left leg forward
  475.             local left_leg_forward = w3.C0 * CFrame.Angles(math.rad(20),0,0) + Vector3.new(0,0,-.35)*android_scale
  476.             --left leg backward
  477.             local left_leg_backward = w3.C0 * CFrame.Angles(math.rad(-20),0,0) + Vector3.new(0,0,.35)*android_scale
  478.            
  479.             --right leg forward
  480.             local right_leg_forward = w4.C0 * CFrame.Angles(math.rad(20),0,0) + Vector3.new(0,0,-.35)*android_scale
  481.             --right leg backward
  482.             local right_leg_backward = w4.C0 * CFrame.Angles(math.rad(-20),0,0) + Vector3.new(0,0,.35)*android_scale
  483.            
  484.            
  485.             while(isWalking) do
  486.                 for i = 0,1,.0333 do
  487.                     if(not isWalking)then break end
  488.                     w1.C0 = left_arm_forward:lerp(left_arm_backward,i)
  489.                     w2.C0 = right_arm_backward:lerp(right_arm_forward,i)
  490.                     if(not isWalking)then break end
  491.                     w3.C0 = left_leg_backward:lerp(left_leg_forward,i)
  492.                     w4.C0 = right_leg_forward:lerp(right_leg_backward,i)
  493.                     run_service.Heartbeat:wait()
  494.                 end
  495.  
  496.                 for j = 0,1,.0333 do
  497.                     if(not isWalking)then break end
  498.                     w1.C0 = left_arm_backward:lerp(left_arm_forward,j)
  499.                     w2.C0 = right_arm_forward:lerp(right_arm_backward,j)
  500.                     if(not isWalking)then break end
  501.                     w3.C0 = left_leg_forward:lerp(left_leg_backward,j)
  502.                     w4.C0 = right_leg_backward:lerp(right_leg_forward,j)
  503.                     run_service.Heartbeat:wait()
  504.                 end
  505.  
  506.         end
  507.     end
  508.    
  509.     end
  510. end
  511.  
  512. -- Animation Variables
  513. animation_thread = coroutine.create(animation_handler)
  514. isIdling = true
  515. run_service = game:GetService("RunService")
  516. isWalking = false
  517.  
  518.  
  519. humanoid.Running:connect(function(s)
  520.     if s>0 then
  521.         isWalking = true
  522.         isIdling = false
  523.     else
  524.         isWalking = false
  525.         isIdling = true
  526.     end
  527. end)
  528.  
  529.  
  530. main()
Advertisement
Add Comment
Please, Sign In to add comment