DrakerMaker

KARMA

Sep 11th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.32 KB | None | 0 0
  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. script.Parent = Player.Character
  5.  
  6. --RemoteEvent for communicating
  7. local Event = Instance.new("RemoteEvent")
  8. Event.Name = "UserInput_Event"
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local function fakeEvent()
  12. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  13. t.connect = t.Connect
  14. return t
  15. end
  16.  
  17. --Creating fake input objects with fake variables
  18. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  19. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  20. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  21. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  22. end}
  23. --Merged 2 functions into one by checking amount of arguments
  24. CAS.UnbindAction = CAS.BindAction
  25.  
  26. --This function will trigger the events that have been :Connect()'ed
  27. local function te(self,ev,...)
  28. local t = m[ev]
  29. if t and t._fakeEvent and t.Function then
  30. t.Function(...)
  31. end
  32. end
  33. m.TrigEvent = te
  34. UIS.TrigEvent = te
  35.  
  36. Event.OnServerEvent:Connect(function(plr,io)
  37. if plr~=Player then return end
  38. if io.isMouse then
  39. m.Target = io.Target
  40. m.Hit = io.Hit
  41. else
  42. local b = io.UserInputState == Enum.UserInputState.Begin
  43. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  44. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  45. end
  46. for _,t in pairs(CAS.Actions) do
  47. for _,k in pairs(t.Keys) do
  48. if k==io.KeyCode then
  49. t.Function(t.Name,io.UserInputState,io)
  50. end
  51. end
  52. end
  53. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  54. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  55. end
  56. end)
  57. Event.Parent = NLS([==[
  58. local Player = game:GetService("Players").LocalPlayer
  59. local Event = script:WaitForChild("UserInput_Event")
  60.  
  61. local UIS = game:GetService("UserInputService")
  62. local input = function(io,a)
  63. if a then return end
  64. --Since InputObject is a client-side instance, we create and pass table instead
  65. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  66. end
  67. UIS.InputBegan:Connect(input)
  68. UIS.InputEnded:Connect(input)
  69.  
  70. local Mouse = Player:GetMouse()
  71. local h,t
  72. --Give the server mouse data 30 times every second, but only if the values changed
  73. --If player is not moving their mouse, client won't fire events
  74. while wait(1/30) do
  75. if h~=Mouse.Hit or t~=Mouse.Target then
  76. h,t=Mouse.Hit,Mouse.Target
  77. Event:FireServer({isMouse=true,Target=t,Hit=h})
  78. end
  79. end]==],Player.Character)
  80. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  81. end
  82. function wbtwe(Part0, Part1, C0)
  83. local weld = Instance.new("Weld", Part0)
  84. weld.Part0 = Part0
  85. weld.Part1 = Part1
  86. weld.C0 = Part1.CFrame:inverse() *Part1.CFrame *C0
  87. return weld
  88. end
  89. function rayCast(Position, Direction, Range, Ignore)
  90. return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
  91. end
  92. hrw = wbtwe(owner.Character.Torso, owner.Character.HumanoidRootPart, CFrame.new(0, 0, 0))
  93. law = wbtwe(owner.Character["Left Arm"], owner.Character.Torso, CFrame.new(1.45, 0.3, 0.1) *CFrame.Angles(0, 25, 0.3))
  94. raw = wbtwe(owner.Character["Right Arm"], owner.Character.Torso, CFrame.new(-1, 0, -0.4) *CFrame.Angles(-2.9, 0, 12))
  95. llw = wbtwe(owner.Character["Left Leg"], owner.Character.Torso, CFrame.new(0.2, 2.4, 0) *CFrame.Angles(0, 25, 0.3))
  96. rlw = wbtwe(owner.Character["Right Leg"], owner.Character.Torso, CFrame.new(-0.2, 2.4, 0) *CFrame.Angles(0, 0, -0.3))
  97. hw = wbtwe(owner.Character.Head, owner.Character.Torso, CFrame.new(0, -1.5, 0) *CFrame.Angles(0, 0.4, 0))
  98. local player = owner
  99. local char = player.Character
  100. local song = Instance.new("Sound", char.Head)
  101. song.SoundId = "rbxassetid://733456981"
  102. song.Volume = 2
  103. song.Looped = true
  104. song.TimePosition = 115.5
  105. song:Play()
  106. local txt = Instance.new("BillboardGui", char)
  107. txt.Adornee = char .Head
  108. txt.Name = "_status"
  109. txt.Size = UDim2.new(2, 0, 0.3, 0)
  110. txt.StudsOffset = Vector3.new(-9, 4, 0)
  111. local text = Instance.new("TextLabel", txt)
  112. text.Size = UDim2.new(10, 0, 7, 0)
  113. text.FontSize = "Size24"
  114. text.TextScaled = true
  115. text.TextTransparency = 0
  116. text.BackgroundTransparency = 1
  117. text.TextTransparency = 0
  118. text.TextStrokeTransparency = 0
  119. text.Font = "Highway"
  120. text.TextStrokeColor3 = BrickColor.new("Dark orange").Color
  121. text.TextColor3 = BrickColor.new("Deep orange").Color
  122. text.Text = "KaRmA"
  123. textsin = 1
  124. idle = 1
  125. run = 1
  126. animing = true
  127. deb = false
  128. color = coroutine.wrap(function()
  129. while game:GetService("RunService").Stepped:wait() do
  130. text.TextStrokeColor3 = BrickColor.Random().Color
  131. text.TextColor3 = BrickColor.Random().Color
  132. textsin = textsin +1
  133. text.Rotation = math.sin(textsin) *3
  134. end
  135. end)color()
  136. spin = coroutine.wrap(function()
  137. while wait() do
  138. local tc = math.random(1,5)
  139. if tc == 1 then
  140. text.Text = "KaRmA"
  141. end
  142. if tc == 2 then
  143. text.Text = "kArMa"
  144. end
  145. if tc == 3 then
  146. text.Text = "KARmA"
  147. end
  148. if tc == 4 then
  149. text.Text = "KaRMA"
  150. end
  151. if tc == 5 then
  152. text.Text = "KarmA"
  153. end
  154. end
  155. end)spin()
  156. twitch = coroutine.wrap(function()
  157. while game:GetService("RunService").Stepped:wait() do
  158. if animing == true then
  159. hw.C0 = hw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0, -1.5, 0) *CFrame.Angles(math.rad(math.random(-15, 15)), 0.4, math.rad(math.random(5, 15))), 0.1)
  160. end
  161. end
  162. end)twitch()
  163. anim = coroutine.wrap(function()
  164. while game:GetService("RunService").Stepped:wait() do
  165. if animing == true then
  166. if char.HumanoidRootPart.Velocity.Magnitude < 1 then
  167. idle = idle +0.1
  168. law.C0=law.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(1.45, 0, 0.1) *CFrame.Angles(0, 25, math.sin(idle) *0.2), 0.1)
  169. end
  170. if char.HumanoidRootPart.Velocity.Magnitude > 1 then
  171. hitfloor, posfloor = rayCast(owner.Character.HumanoidRootPart.Position, CFrame.new(owner.Character.HumanoidRootPart.Position, owner.Character.HumanoidRootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4 * 1, owner.Character)
  172. if hitfloor then
  173. run = run +0.1
  174. law.C0=law.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(1.45, 0.1, math.sin(run) *0.8) *CFrame.Angles(math.sin(-run) *0.8, 25, 0), 0.1)
  175. llw.C0=llw.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(0.45, 2.4, math.sin(run) *0.1) *CFrame.Angles(math.sin(-run) *0.8, 25, 0), 0.1)
  176. rlw.C0=rlw.C0:lerp(owner.Character.HumanoidRootPart.CFrame:inverse() *owner.Character.HumanoidRootPart.CFrame *CFrame.new(-0.4, 2.4, math.sin(-run) *0.1) *CFrame.Angles(math.sin(run) *0.8, 25, 0), 0.1)
  177. end
  178. if hitfloor == nil then
  179. end
  180. end
  181. end
  182. end
  183. end)anim()
Add Comment
Please, Sign In to add comment