Advertisement
kostik228

GRIM

Nov 21st, 2018
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.00 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = owner
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local Mouse = owner
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86. Player = owner
  87. PlayerGui = Player.PlayerGui
  88. Cam = workspace.CurrentCamera
  89. Backpack = Player.Backpack
  90. Character = Player.Character
  91. Humanoid = Character.Humanoid
  92. RootPart = Character["HumanoidRootPart"]
  93. Torso = Character["Torso"]
  94. Head = Character["Head"]
  95. RightArm = Character["Right Arm"]
  96. LeftArm = Character["Left Arm"]
  97. RightLeg = Character["Right Leg"]
  98. LeftLeg = Character["Left Leg"]
  99. RootJoint = RootPart["RootJoint"]
  100. Neck = Torso["Neck"]
  101. RightShoulder = Torso["Right Shoulder"]
  102. LeftShoulder = Torso["Left Shoulder"]
  103. RightHip = Torso["Right Hip"]
  104. LeftHip = Torso["Left Hip"]
  105. local sick = Instance.new("Sound",Character)
  106. sick.SoundId = "rbxassetid://563062677"
  107. sick.Looped = true
  108. sick.Pitch = 1
  109. sick.Volume = 2
  110. Player:ClearCharacterAppearance()
  111. local HANDS = {}
  112. Character.Archivable = true
  113. Humanoid.DisplayDistanceType = "None"
  114.  
  115. local naeeym2 = Instance.new("BillboardGui",Character)
  116. naeeym2.AlwaysOnTop = true
  117. naeeym2.Size = UDim2.new(5,35,2,35)
  118. naeeym2.StudsOffset = Vector3.new(0,3,0)
  119. naeeym2.Adornee = Character.Head
  120. naeeym2.Name = "Name"
  121. naeeym2.PlayerToHideFrom = Player
  122. local tecks2 = Instance.new("TextLabel",naeeym2)
  123. tecks2.BackgroundTransparency = 1
  124. tecks2.TextScaled = true
  125. tecks2.BorderSizePixel = 0
  126. tecks2.Text = "Grim"
  127. tecks2.Font = "Antique"
  128. tecks2.TextSize = 30
  129. tecks2.TextTransparency = 1
  130. tecks2.TextStrokeTransparency = 1
  131. tecks2.TextColor3 = Color3.new(1,0,0)
  132. tecks2.Size = UDim2.new(1,0,0.5,0)
  133. tecks2.Parent = naeeym2
  134.  
  135. IT = Instance.new
  136. CF = CFrame.new
  137. VT = Vector3.new
  138. RAD = math.rad
  139. C3 = Color3.new
  140. UD2 = UDim2.new
  141. BRICKC = BrickColor.new
  142. ANGLES = CFrame.Angles
  143. EULER = CFrame.fromEulerAnglesXYZ
  144. COS = math.cos
  145. ACOS = math.acos
  146. SIN = math.sin
  147. ASIN = math.asin
  148. ABS = math.abs
  149. MRANDOM = math.random
  150. FLOOR = math.floor
  151.  
  152. function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET)
  153. local NEWMESH = IT(MESH)
  154. if MESH == "SpecialMesh" then
  155. NEWMESH.MeshType = MESHTYPE
  156. if MESHID ~= "nil" and MESHID ~= "" then
  157. NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID
  158. end
  159. if TEXTUREID ~= "nil" and TEXTUREID ~= "" then
  160. NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID
  161. end
  162. end
  163. NEWMESH.Offset = OFFSET or VT(0, 0, 0)
  164. NEWMESH.Scale = SCALE
  165. NEWMESH.Parent = PARENT
  166. return NEWMESH
  167. end
  168.  
  169. function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
  170. local NEWPART = IT("Part")
  171. NEWPART.formFactor = FORMFACTOR
  172. NEWPART.Reflectance = REFLECTANCE
  173. NEWPART.Transparency = TRANSPARENCY
  174. NEWPART.CanCollide = false
  175. NEWPART.Locked = true
  176. NEWPART.Anchored = true
  177. if ANCHOR == false then
  178. NEWPART.Anchored = false
  179. end
  180. NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
  181. NEWPART.Name = NAME
  182. NEWPART.Size = SIZE
  183. NEWPART.Position = Torso.Position
  184. NEWPART.Material = MATERIAL
  185. NEWPART:BreakJoints()
  186. NEWPART.Parent = PARENT
  187. return NEWPART
  188. end
  189.  
  190. --//=================================\\
  191. --|| CUSTOMIZATION
  192. --\\=================================//
  193.  
  194. Player_Size = 1 --Size of the player.
  195. Animation_Speed = 3
  196. Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60)
  197.  
  198. local Speed = 16
  199. local Effects2 = {}
  200.  
  201. --//=================================\\
  202. --|| END OF CUSTOMIZATION
  203. --\\=================================//
  204.  
  205. local function weldBetween(a, b)
  206. local weldd = Instance.new("ManualWeld")
  207. weldd.Part0 = a
  208. weldd.Part1 = b
  209. weldd.C0 = CFrame.new()
  210. weldd.C1 = b.CFrame:inverse() * a.CFrame
  211. weldd.Parent = a
  212. return weldd
  213. end
  214.  
  215. --//=================================\\
  216. --|| USEFUL VALUES
  217. --\\=================================//
  218.  
  219. local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
  220. local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
  221. local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0))
  222. local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0))
  223. local CHANGEDEFENSE = 0
  224. local CHANGEDAMAGE = 0
  225. local CHANGEMOVEMENT = 0
  226. local ANIM = "Idle"
  227. local ATTACK = false
  228. local EQUIPPED = false
  229. local HOLD = false
  230. local COMBO = 1
  231. local Rooted = false
  232. local SINE = 0
  233. local KEYHOLD = false
  234. local CHANGE = 2 / Animation_Speed
  235. local WALKINGANIM = false
  236. local WALK = 0
  237. local VALUE1 = false
  238. local VALUE2 = false
  239. local ROBLOXIDLEANIMATION = IT("Animation")
  240. ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation"
  241. ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  242. --ROBLOXIDLEANIMATION.Parent = Humanoid
  243. local WEAPONGUI = IT("ScreenGui", PlayerGui)
  244. WEAPONGUI.Name = "Weapon GUI"
  245. local Weapon = IT("Model")
  246. Weapon.Name = "Weapon"
  247. local Effects = IT("Folder", Weapon)
  248. Effects.Name = "Effects"
  249. local ANIMATOR = Humanoid.Animator
  250. local ANIMATE = Character.Animate
  251. local HITPLAYERSOUNDS = {--[["199149137", "199149186", "199149221", "199149235", "199149269", "199149297"--]]"263032172", "263032182", "263032200", "263032221", "263032252", "263033191"}
  252. local HITARMORSOUNDS = {"199149321", "199149338", "199149367", "199149409", "199149452"}
  253. local HITWEAPONSOUNDS = {"199148971", "199149025", "199149072", "199149109", "199149119"}
  254. local HITBLOCKSOUNDS = {"199148933", "199148947"}
  255. local UNANCHOR = true
  256. local INTRO = false
  257. local TRANSFORMED = false
  258. local INSTANT = true
  259.  
  260. local SKILLTEXTCOLOR = BRICKC("Black").Color
  261.  
  262. --//=================================\\
  263. --\\=================================//
  264.  
  265.  
  266. --//=================================\\
  267. --|| SAZERENOS' ARTIFICIAL HEARTBEAT
  268. --\\=================================//
  269.  
  270. ArtificialHB = Instance.new("BindableEvent", script)
  271. ArtificialHB.Name = "ArtificialHB"
  272.  
  273. script:WaitForChild("ArtificialHB")
  274.  
  275. frame = Frame_Speed
  276. tf = 0
  277. allowframeloss = false
  278. tossremainder = false
  279. lastframe = tick()
  280. script.ArtificialHB:Fire()
  281.  
  282. game:GetService("RunService").Heartbeat:connect(function(s, p)
  283. tf = tf + s
  284. if tf >= frame then
  285. if allowframeloss then
  286. script.ArtificialHB:Fire()
  287. lastframe = tick()
  288. else
  289. for i = 1, math.floor(tf / frame) do
  290. script.ArtificialHB:Fire()
  291. end
  292. lastframe = tick()
  293. end
  294. if tossremainder then
  295. tf = 0
  296. else
  297. tf = tf - frame * math.floor(tf / frame)
  298. end
  299. end
  300. end)
  301.  
  302. --//=================================\\
  303. --\\=================================//
  304.  
  305.  
  306.  
  307.  
  308.  
  309. --//=================================\\
  310. --|| SOME FUNCTIONS
  311. --\\=================================//
  312.  
  313. function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS)
  314. return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS)
  315. end
  316.  
  317. function PositiveAngle(NUMBER)
  318. if NUMBER >= 0 then
  319. NUMBER = 0
  320. end
  321. return NUMBER
  322. end
  323.  
  324. function NegativeAngle(NUMBER)
  325. if NUMBER <= 0 then
  326. NUMBER = 0
  327. end
  328. return NUMBER
  329. end
  330.  
  331. function Swait(NUMBER)
  332. if NUMBER == 0 or NUMBER == nil then
  333. ArtificialHB.Event:wait()
  334. else
  335. for i = 1, NUMBER do
  336. ArtificialHB.Event:wait()
  337. end
  338. end
  339. end
  340.  
  341. function QuaternionFromCFrame(cf)
  342. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  343. local trace = m00 + m11 + m22
  344. if trace > 0 then
  345. local s = math.sqrt(1 + trace)
  346. local recip = 0.5 / s
  347. return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  348. else
  349. local i = 0
  350. if m11 > m00 then
  351. i = 1
  352. end
  353. if m22 > (i == 0 and m00 or m11) then
  354. i = 2
  355. end
  356. if i == 0 then
  357. local s = math.sqrt(m00 - m11 - m22 + 1)
  358. local recip = 0.5 / s
  359. return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  360. elseif i == 1 then
  361. local s = math.sqrt(m11 - m22 - m00 + 1)
  362. local recip = 0.5 / s
  363. return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  364. elseif i == 2 then
  365. local s = math.sqrt(m22 - m00 - m11 + 1)
  366. local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  367. end
  368. end
  369. end
  370.  
  371. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  372. local xs, ys, zs = x + x, y + y, z + z
  373. local wx, wy, wz = w * xs, w * ys, w * zs
  374. local xx = x * xs
  375. local xy = x * ys
  376. local xz = x * zs
  377. local yy = y * ys
  378. local yz = y * zs
  379. local zz = z * zs
  380. return CFrame.new(px, py, pz, 1 - (yy + zz), xy - wz, xz + wy, xy + wz, 1 - (xx + zz), yz - wx, xz - wy, yz + wx, 1 - (xx + yy))
  381. end
  382.  
  383. function QuaternionSlerp(a, b, t)
  384. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  385. local startInterp, finishInterp;
  386. if cosTheta >= 0.0001 then
  387. if (1 - cosTheta) > 0.0001 then
  388. local theta = ACOS(cosTheta)
  389. local invSinTheta = 1 / SIN(theta)
  390. startInterp = SIN((1 - t) * theta) * invSinTheta
  391. finishInterp = SIN(t * theta) * invSinTheta
  392. else
  393. startInterp = 1 - t
  394. finishInterp = t
  395. end
  396. else
  397. if (1 + cosTheta) > 0.0001 then
  398. local theta = ACOS(-cosTheta)
  399. local invSinTheta = 1 / SIN(theta)
  400. startInterp = SIN((t - 1) * theta) * invSinTheta
  401. finishInterp = SIN(t * theta) * invSinTheta
  402. else
  403. startInterp = t - 1
  404. finishInterp = t
  405. end
  406. end
  407. return a[1] * startInterp + b[1] * finishInterp, a[2] * startInterp + b[2] * finishInterp, a[3] * startInterp + b[3] * finishInterp, a[4] * startInterp + b[4] * finishInterp
  408. end
  409.  
  410. function Clerp(a, b, t)
  411. local qa = {QuaternionFromCFrame(a)}
  412. local qb = {QuaternionFromCFrame(b)}
  413. local ax, ay, az = a.x, a.y, a.z
  414. local bx, by, bz = b.x, b.y, b.z
  415. local _t = 1 - t
  416. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  417. end
  418.  
  419. function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME)
  420. local frame = IT("Frame")
  421. frame.BackgroundTransparency = TRANSPARENCY
  422. frame.BorderSizePixel = BORDERSIZEPIXEL
  423. frame.Position = POSITION
  424. frame.Size = SIZE
  425. frame.BackgroundColor3 = COLOR
  426. frame.BorderColor3 = BORDERCOLOR
  427. frame.Name = NAME
  428. frame.Parent = PARENT
  429. return frame
  430. end
  431.  
  432. function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME)
  433. local label = IT("TextLabel")
  434. label.BackgroundTransparency = 1
  435. label.Size = UD2(1, 0, 1, 0)
  436. label.Position = UD2(0, 0, 0, 0)
  437. label.TextColor3 = TEXTCOLOR
  438. label.TextStrokeTransparency = STROKE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement