SHARE
TWEET

My Goodbye Gift

Nater12325 Jun 20th, 2019 (edited) 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4.     print("FE Compatibility code by Mokiros")
  5.     script.Parent = Player.Character
  6.  
  7.     --RemoteEvent for communicating
  8.     local Event = Instance.new("RemoteEvent")
  9.     Event.Name = "UserInput_Event"
  10.  
  11.     --Fake event to make stuff like Mouse.KeyDown work
  12.     local function fakeEvent()
  13.         local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14.         t.connect = t.Connect
  15.         return t
  16.     end
  17.  
  18.     --Creating fake input objects with fake variables
  19.     local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20.     local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21.     local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22.         CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23.     end}
  24.     --Merged 2 functions into one by checking amount of arguments
  25.     CAS.UnbindAction = CAS.BindAction
  26.  
  27.     --This function will trigger the events that have been :Connect()'ed
  28.     local function te(self,ev,...)
  29.         local t = m[ev]
  30.         if t and t._fakeEvent and t.Function then
  31.             t.Function(...)
  32.         end
  33.     end
  34.     m.TrigEvent = te
  35.     UIS.TrigEvent = te
  36.  
  37.     Event.OnServerEvent:Connect(function(plr,io)
  38.         if plr~=Player then return end
  39.         if io.isMouse then
  40.             m.Target = io.Target
  41.             m.Hit = io.Hit
  42.         else
  43.             local b = io.UserInputState == Enum.UserInputState.Begin
  44.             if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45.                 return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46.             end
  47.             for _,t in pairs(CAS.Actions) do
  48.                 for _,k in pairs(t.Keys) do
  49.                     if k==io.KeyCode then
  50.                         t.Function(t.Name,io.UserInputState,io)
  51.                     end
  52.                 end
  53.             end
  54.             m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55.             UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56.         end
  57.     end)
  58.     Event.Parent = NLS([==[
  59.     local Player = game:GetService("Players").LocalPlayer
  60.     local Event = script:WaitForChild("UserInput_Event")
  61.  
  62.     local UIS = game:GetService("UserInputService")
  63.     local input = function(io,a)
  64.         if a then return end
  65.         --Since InputObject is a client-side instance, we create and pass table instead
  66.         Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67.     end
  68.     UIS.InputBegan:Connect(input)
  69.     UIS.InputEnded:Connect(input)
  70.  
  71.     local Mouse = Player:GetMouse()
  72.     local h,t
  73.     --Give the server mouse data 30 times every second, but only if the values changed
  74.     --If player is not moving their mouse, client won't fire events
  75.     while wait(1/30) do
  76.         if h~=Mouse.Hit or t~=Mouse.Target then
  77.             h,t=Mouse.Hit,Mouse.Target
  78.             Event:FireServer({isMouse=true,Target=t,Hit=h})
  79.         end
  80.     end]==],Player.Character)
  81.     Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83. plr = owner
  84. char = plr.Character
  85.  
  86. print('Made by Theamazingnater')
  87. print('Controls: Click to attack, E to switch modes, T to switch music')
  88. print('Hit dem notes!')
  89.  
  90. Player = plr
  91.     Character = Player.Character
  92.     local txt = Instance.new("BillboardGui", Character)
  93.     txt.Adornee = Character.Head
  94.     txt.Name = "_status"
  95.     txt.Size = UDim2.new(2, 0, 1.2, 0)
  96.     txt.StudsOffset = Vector3.new(-9, 8, 0)
  97.     local text = Instance.new("TextLabel", txt)
  98.     text.Size = UDim2.new(10, 0, 7, 0)
  99.     text.FontSize = "Size24"
  100.     text.TextScaled = true
  101.     text.TextTransparency = 0
  102.     text.BackgroundTransparency = 1
  103.     text.TextTransparency = 0
  104.     text.TextStrokeTransparency = 0
  105.     text.Font = "Arcade"
  106.     text.TextStrokeColor3 = char.Torso.BrickColor.Color
  107.         text.Text = "Beat Saber: Easy"
  108.  
  109. local attacking = false
  110. local difficulty = "Easy"
  111.  
  112. local SabersModel = Instance.new("Model")
  113. local Weld1 = Instance.new("Weld")
  114. local Weld2 = Instance.new("Weld")
  115. local Weld3 = Instance.new("Weld")
  116. local Weld4 = Instance.new("Weld")
  117. local BlueSBase = Instance.new("Part")
  118. local BlueS = Instance.new("Part")
  119. local RedSBase = Instance.new("Part")
  120. local RedS = Instance.new("Part")
  121. BlueSBase.BrickColor = BrickColor.new("Electric blue")
  122. BlueSBase.Shape = Enum.PartType.Cylinder
  123. BlueSBase.Material = Enum.Material.DiamondPlate
  124. BlueSBase.Size = Vector3.new(2.08, 0.45, 1)
  125. BlueSBase.Parent = SabersModel
  126. Weld1.Parent = BlueSBase
  127. Weld1.Part0 = char["Right Arm"]
  128. Weld1.Part1 = BlueSBase
  129. Weld1.C0 = CFrame.new(-0.00518798828, -0.929286242, -0.137907028, 0, 0, -1, 0, 0.999992609, 0, 1, 0, 0)
  130. BlueS.BrickColor = BrickColor.new("Bright blue")
  131. BlueS.Material = Enum.Material.Neon
  132. BlueS.Parent = SabersModel
  133. BlueS.Shape = Enum.PartType.Cylinder
  134. BlueS.Size = Vector3.new(4.52, 0.45, 0.35)
  135. BlueS.CanCollide = false
  136. Weld2.Parent = BlueS
  137. Weld2.Part0 = BlueS
  138. Weld2.Part1 = BlueSBase
  139. Weld2.C0 = CFrame.new(3.27787209, 0, -0.0136032104, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  140. RedSBase.BrickColor = BrickColor.new("Bright red")
  141. RedSBase.Material = Enum.Material.DiamondPlate
  142. RedSBase.Shape = Enum.PartType.Cylinder
  143. RedSBase.Size = Vector3.new(2.08, 0.45, 1)
  144. RedSBase.Parent = SabersModel
  145. Weld3.Parent = RedSBase
  146. Weld3.Part0 = char["Left Arm"]
  147. Weld3.Part1 = RedSBase
  148. Weld3.C0 = CFrame.new(0.0032491684, -0.941065311, -0.137907028, 0, 0, -1, 0, 0.999992609, 0, 1, 0, 0)
  149. RedS.BrickColor = BrickColor.new("Really red")
  150. RedS.Material = Enum.Material.Neon
  151. RedS.Shape = Enum.PartType.Cylinder
  152. RedS.Size = Vector3.new(4.52, 0.45, 0.35)
  153. RedS.Parent = SabersModel
  154. RedS.CanCollide = false
  155. Weld4.Parent = RedS
  156. Weld4.Part0 = RedSBase
  157. Weld4.Part1 = RedS
  158. Weld4.C0 = CFrame.new(-3.27787209, -1.38282776e-05, 0.0158214569, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  159. SabersModel.Parent = workspace
  160.  
  161. local rhandweld = Instance.new("Weld", plr.Character)
  162. rhandweld.Part0 = char.Torso
  163. rhandweld.Part1 = char["Right Arm"]
  164. rhandweld.C0 = CFrame.new(1.5, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1)
  165. local lhandweld = Instance.new("Weld", char)
  166. lhandweld.Part0 = char.Torso
  167. lhandweld.Part1 = char["Left Arm"]
  168. lhandweld.C0 = CFrame.new(-1.5, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1)
  169.  
  170. local music = Instance.new("Sound",char)
  171. music.SoundId = "rbxassetid://3195950486"
  172. music.Volume = 1
  173. music:Play()
  174. music.Looped = false
  175.  
  176. chara = char
  177. cananimate = true
  178. pose = "Standing"
  179. local speed = 0
  180.  
  181. function spinAttack()
  182.     if attacking ~= true then
  183.         cananimate = false
  184.         wait(1)
  185.         attacking = true
  186.         local touchie = RedS.Touched:connect(function(hit)
  187.             human = hit.Parent.Humanoid
  188.             if human.Parent.Name ~= "Theamazingnater" or human.Parent.Name ~= plr.Name then
  189.                 if difficulty == "Easy" then
  190.                     human:TakeDamage(10)
  191.                 end
  192.                 if difficulty == "Normal" then
  193.                     human:TakeDamage(15)
  194.                 end
  195.                 if difficulty == "Hard" then
  196.                     human:TakeDamage(20)
  197.                 end
  198.                 if difficulty == "Expert" then
  199.                     human:TakeDamage(30)
  200.                 end
  201.                 if difficulty == "Expert+" then
  202.                     human:TakeDamage(40)
  203.                 end
  204.             end
  205.         end)
  206.         for i = 0,1 ,0.3 do
  207.         wait()
  208.         rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.95062065, 0.464681864, 0, -0.00532999961, -0.999985874, 0, 0.999985874, -0.00533000007, 0, 0, 0, 1),i)
  209.         lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.94851112, 0.489989042, 0, -0.000345000008, 1, 0, -1, -0.000345000008, 0, 0, 0, 1),i)
  210.         end
  211.         for i = 1,45 do
  212.         char.Torso.CFrame = char.Torso.CFrame * CFrame.Angles(0,math.rad(36),0)
  213.         wait()
  214.         end
  215.         touchie:Disconnect()
  216.         cananimate = true
  217.         attacking = false
  218.     end
  219. end
  220.  
  221. char.Humanoid.Running:connect(function(s)
  222.     speed = s
  223. end)
  224.  
  225. mouse.KeyDown:connect(function(key)
  226.     if key == "e" then
  227.         local chance = math.random(1,5)
  228.         if chance == 1 then
  229.             difficulty = "Easy"
  230.             music.PlaybackSpeed = 0.5
  231.         end
  232.         if chance == 2 then
  233.             difficulty = "Normal"
  234.             music.PlaybackSpeed = 1
  235.         end
  236.         if chance == 3 then
  237.             difficulty = "Hard"
  238.             music.PlaybackSpeed = 1.5
  239.         end
  240.         if chance == 4 then
  241.             difficulty = "Expert"
  242.             music.PlaybackSpeed = 2
  243.         end
  244.         if chance == 5 then
  245.             difficulty = "Expert+"
  246.             music.PlaybackSpeed = 2.5
  247.         end
  248.     end
  249.     if key == "t" then
  250.         local chance = math.random(1,3)
  251.         if chance == 1 then
  252.             music.SoundId = "rbxassetid://3195950486"
  253.             print('Now playing Rum n Bass by Boom Kitty')
  254.         end
  255.         if chance == 2 then
  256.             music.SoundId = "rbxassetid://1751020667"
  257.             print('Now playing 100$ Bills by Jaroslav')
  258.         end
  259.         if chance == 3 then
  260.             music.SoundId = "rbxassetid://1721448336"
  261.             print('Now playing Escape ft. Summer Haze by Jaroslav')
  262.         end
  263.     end
  264. end)
  265.  
  266. mouse.Button1Down:connect(function()
  267.     spinAttack()
  268. end)
  269.  
  270. while true do
  271.     wait()
  272.     text.Text = "Beat Saber: " .. difficulty
  273.     local ray = Ray.new(chara.Torso.Position, (chara.Torso.Position - Vector3.new(0,9999999,0)).unit * 300)
  274.     local p, position = game.Workspace:FindPartOnRay(ray, char, true, false)
  275.     local dis = (chara.Torso.Position - position).magnitude
  276.     if dis > 3.8 and chara.Torso.Velocity.Y > 0 then
  277.         pose = "Jumping"
  278.     end
  279.     if dis> 3.8 and chara.Torso.Velocity.Y < 0 then
  280.         pose = "Falling"
  281.     end
  282.     if dis < 3.8 and speed == 0 then
  283.         pose = "Standing"
  284.     end
  285.     if dis < 3.8 and speed > 0 then
  286.         pose = "Walking"
  287.     end
  288.     if pose == "Standing" and cananimate then
  289.         walking = false
  290.         for i = 0,1 , 0.05 do
  291.             lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.5, 2.38418579e-07, 0, 0.901208401, -0.433386177, 0, 0.433385074, 0.901205897, 0, 0, 0, 1),i)
  292.             rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.58996058, -0.0167350769, 9.53674316e-07, 0.933032632, 0.359789908, 0, -0.359790921, 0.933025062, 0, 0, 0, 1),i)
  293.             wait()
  294.         end  
  295.     end
  296.     if pose == "Walking" and cananimate then
  297.                    walking = true
  298.                    for i = 0,1 ,0.05 do
  299.                     lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.5, 0.168842316, -0.374614239, 1, 0, 0, 0, 0.662306964, -0.74923259, 0, 0.74923259, 0.662307084),i)
  300.                     rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.12597847, 0.331827164, 1, 0, 0, 0, 0.748035073, 0.663659215, 0, -0.663659275, 0.748035014),i)
  301.                     wait()
  302.             end
  303.             walking = true
  304.             for i = 0,1 ,0.05 do
  305.                     lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.5, 0.216003418, 0.411518574, 1, 0, 0, 0, 0.567983389, 0.823040009, 0, -0.823040009, 0.567983389),i)
  306.                     rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.215018272, -0.41083622, 1, 0, 0, 0, 0.569954693, -0.821676135, 0, 0.821676135, 0.569954753),i)
  307.                     wait()
  308.             end
  309.             walking = true
  310.     end
  311.     if pose == "Jumping" and cananimate then
  312.     walking = false
  313.      for i = 0,1 , 0.05 do
  314.          rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.66472816, 0.166806221, 0, 0.840905726, -0.541181803, 0, 0.541181803, 0.840905726, 0, 0, 0, 1),i)
  315.          lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.69600487, 0.110276461, 0, 0.871529698, 0.490342826, 0, -0.490342826, 0.871529698, 0, 0, 0, 1),i)
  316.          wait()
  317.          end  
  318.     end
  319.     if pose == "Falling" and cananimate then
  320.         walking = false
  321.          for i = 0,1 , 0.05 do
  322.          rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(2.00721169, 0.966965914, 0, -0.554754853, -0.832013845, 0, 0.832013845, -0.554754853, 0, 0, 0, 1),i)
  323.          lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.87815094, 0.913155079, 0, -0.494452, 0.869204998, 0, -0.869204998, -0.494452, 0, 0, 0, 1),i)
  324.          wait()
  325.          end      
  326.     end
  327. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top