Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("by not 228228228229UE, by my friend")
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
- script.Parent = Player.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- local Plr=owner
- local Chr=Plr.Character
- if Chr.Name ~= "dragen1576" and Chr.Name ~= "lafur2" and Chr.Name ~= "228228228229UE" then
- print('ask dragen1576 to be added in whitelist')
- Chr:BreakJoints()
- end
- local Hum=Chr.Humanoid
- local Hed=Chr.Head
- local Trs=Chr.Torso
- local RA=Chr['Right Arm']
- local LA=Chr['Left Arm']
- local RL=Chr['Right Leg']
- local LL=Chr['Left Leg']
- local Nck = Trs["Neck"]
- local root=Chr.HumanoidRootPart
- local rootj=root.RootJoint
- local RootCF=CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
- local RHCF=CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
- local LHCF=CFrame.fromEulerAnglesXYZ(0, -1.6, 0)
- Ncko=CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
- RW=Instance.new("Weld")
- LW=Instance.new("Weld")
- RH=Trs["Right Hip"]
- LH=Trs["Left Hip"]
- PS=1
- sine=1
- change=1
- Nck.Parent=Trs
- Hed.Mesh.MeshId="rbxassetid://625943420"
- Hed.Mesh.TextureId="rbxassetid://625943441"
- Hed.Mesh.Scale=Vector3.new(2, 2, 2)
- --Pineapple.TextureId="rbxassetid://625943441"
- ----Script Audio----
- CurTheme=Instance.new("Sound",Trs)
- CurTheme.Name="Pinnaple"
- CurTheme.Looped=true
- CurTheme.SoundId="rbxassetid://2857752354"
- CurTheme.Volume=1
- CurTheme:play()
- sickee=Instance.new("FlangeSoundEffect", CurTheme)
- for i,v in pairs(Chr:children()) do
- if v:IsA("Hat") then
- v:Destroy()
- end
- end
- for i,v in pairs(Chr:children()) do
- if v:IsA("Accessory") then
- v:Destroy()
- end
- end
- for i,v in pairs(Chr:children()) do
- if v:IsA("Hair") then
- v:Destroy()
- end
- end
- ----Basic Values----
- cam = game.Workspace.CurrentCamera
- CF = CFrame.new
- angles = CFrame.Angles
- attack = false
- Euler = CFrame.fromEulerAnglesXYZ
- Rad = math.rad
- IT = Instance.new
- BrickC = BrickColor.new
- Cos = math.cos
- Acos = math.acos
- Sin = math.sin
- Asin = math.asin
- Abs = math.abs
- Mrandom = math.random
- Floor = math.floor
- local idle = 0
- Nck.C0 = Ncko * CFrame.new(0 * PS, 0 * PS, 0 + ((1 * PS) - 1)) * angles(Rad(0), Rad(0), Rad(0))
- ----Baisc Functions----
- --lmao still remember!
- function swait(num)
- if num == 0 or num == nil then
- game:service("RunService").Stepped:wait(0)
- else
- for i = 0, num do
- game:service("RunService").Stepped:wait(0)
- end
- end
- end
- function thread(f)
- coroutine.resume(coroutine.create(f))
- end
- function clerp(a, b, t)
- local qa = {
- QuaternionFromCFrame(a)
- }
- local qb = {
- QuaternionFromCFrame(b)
- }
- local ax, ay, az = a.x, a.y, a.z
- local bx, by, bz = b.x, b.y, b.z
- local _t = 1 - t
- return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
- end
- function QuaternionFromCFrame(cf)
- local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
- local trace = m00 + m11 + m22
- if trace > 0 then
- local s = math.sqrt(1 + trace)
- local recip = 0.5 / s
- return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
- else
- local i = 0
- if m00 < m11 then
- i = 1
- end
- if m22 > (i == 0 and m00 or m11) then
- i = 2
- end
- if i == 0 then
- local s = math.sqrt(m00 - m11 - m22 + 1)
- local recip = 0.5 / s
- return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
- elseif i == 1 then
- local s = math.sqrt(m11 - m22 - m00 + 1)
- local recip = 0.5 / s
- return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
- elseif i == 2 then
- local s = math.sqrt(m22 - m00 - m11 + 1)
- local recip = 0.5 / s
- return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
- end
- end
- end
- function QuaternionToCFrame(px, py, pz, x, y, z, w)
- local xs, ys, zs = x + x, y + y, z + z
- local wx, wy, wz = w * xs, w * ys, w * zs
- local xx = x * xs
- local xy = x * ys
- local xz = x * zs
- local yy = y * ys
- local yz = y * zs
- local zz = z * zs
- 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))
- end
- function QuaternionSlerp(a, b, t)
- local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
- local startInterp, finishInterp
- if cosTheta >= 1.0E-4 then
- if 1 - cosTheta > 1.0E-4 then
- local theta = math.acos(cosTheta)
- local invSinTheta = 1 / Sin(theta)
- startInterp = Sin((1 - t) * theta) * invSinTheta
- finishInterp = Sin(t * theta) * invSinTheta
- else
- startInterp = 1 - t
- finishInterp = t
- end
- elseif 1 + cosTheta > 1.0E-4 then
- local theta = math.acos(-cosTheta)
- local invSinTheta = 1 / Sin(theta)
- startInterp = Sin((t - 1) * theta) * invSinTheta
- finishInterp = Sin(t * theta) * invSinTheta
- else
- startInterp = t - 1
- finishInterp = t
- end
- 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
- end
- function rayCast(Position, Direction, Range, Ignore)
- return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
- end
- local RbxUtility = LoadLibrary("RbxUtility")
- local Create = RbxUtility.Create
- local ANIMATOR = Hum.Animator
- local ANIMATE = Chr.Animate
- ANIMATE.Parent = nil
- ANIMATOR.Parent = nil
- ----Main Part Of Script----
- function step(num)
- if num == 0 or num == nil then
- game:GetService("RunService").Stepped:Wait()
- elseif num ~= 0 or num ~= nil then
- game:GetService("RunService").Stepped:Wait(num)
- end
- end
- mouse.Button1Down:Connect(function()
- local p = Instance.new("Part", Chr)--the bullet u can customize it
- p.Anchored = true
- p.Transparency = 0
- p.Material = "Neon"
- p.Color=Color3.new(0,0,0)
- p.CanCollide = false
- local start = Trs.Position +Vector3.new(0,0,0) --start point u set
- local endp = mouse.Hit.p
- local ray = Ray.new(start, (endp-start).unit * 999)--the ray we are using
- local hit,position = workspace:FindPartOnRayWithIgnoreList(ray, {Chr, Trs})--this finds the parts that the ray is touching with a list of things the ray has to ignore
- local mag = (start-position).magnitude + 2--magnitude of the position
- p.Size = Vector3.new(0.1,0.1,mag)
- p.CFrame = CFrame.new(start, position) *CFrame.new(0,0,-mag/2)
- spawn(function()
- for i = 1, 10 do
- swait()
- p.Transparency = i/10
- p.Size = Vector3.new(1,1,mag)
- step()
- end
- p:Destroy()
- end)
- p.Touched:Connect(function(hit)
- if hit ~= owner and hit.name ~= "pineapple" and hit.Parent.name ~= owner.name then
- --pineapplekill=Instance.new("Part", workspace)
- --pineapplekill.name = "pineapple"
- --pineapplekill.Position=hit.Position
- --hit:Destroy()
- Pineapplemanmesh=Instance.new("SpecialMesh", hit)
- Pineapplemanmesh.MeshId="rbxassetid://625943420"
- Pineapplemanmesh.TextureId="rbxassetid://625943441"
- Pineapplemanmesh.Scale=Vector3.new(2, 2, 2)
- end
- end)
- end)
- ----Stuff that will make animation go normally----
- necko = CF(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
- RSH, LSH = nil, nil
- RW = Instance.new("Weld")
- LW = Instance.new("Weld")
- RH = Trs["Right Hip"]
- LH = Trs["Left Hip"]
- RSH = Trs["Right Shoulder"]
- LSH = Trs["Left Shoulder"]
- RSH.Parent = nil
- LSH.Parent = nil
- RW.Name = "RW"
- RW.Part0 = Trs
- RW.C0 = CF(1.5, 0.5, 0)
- RW.C1 = CF(0, 0.5, 0)
- RW.Part1 = RA
- RW.Parent = Trs
- LW.Name = "LW"
- LW.Part0 = Trs
- LW.C0 = CF(-1.5, 0.5, 0)
- LW.C1 = CF(0, 0.5, 0)
- LW.Part1 = LA
- LW.Parent = Trs
- vt = Vector3.new
- Effects = {}
- ----------------------------------------------------------------------------------
- rootj.Parent = root
- Nck.Parent = Trs
- RW.Parent = Trs
- LW.Parent = Trs
- RH.Parent = Trs
- LH.Parent = Trs
- ----------------------------------------------------------------------------------
- rootj.C0 = RootCF * CF(0 * PS, 0 * PS, 0 * PS) * angles(Rad(0), Rad(0), Rad(0))
- rootj.C1 = RootCF * CF(0 * PS, 0 * PS, 0 * PS) * angles(Rad(0), Rad(0), Rad(0))
- Nck.C0 = necko * CF(-0.1 * PS, 0.1 * PS, 0.5 + ((1 * PS) - 1)) * angles(Rad(0), Rad(0), Rad(0))
- Nck.C1 = CF(0 * PS, -0.80 * PS, 0 * PS) * angles(Rad(-90), Rad(0), Rad(180))
- RW.C0 = CF(1.5 * PS, 0.5 * PS, 0 * PS) * angles(Rad(0), Rad(0), Rad(0))
- LW.C0 = CF(-1.5 * PS, 0.5 * PS, 0 * PS) * angles(Rad(0), Rad(0), Rad(0))
- ----------------------------------------------------------------------------------
- RH.C0 = CF(1 * PS, -1 * PS, 0 * PS) * angles(Rad(0), Rad(90), Rad(0)) * angles(Rad(0), Rad(0), Rad(0))
- LH.C0 = CF(-1 * PS, -1 * PS, 0 * PS) * angles(Rad(0), Rad(-90), Rad(0)) * angles(Rad(0), Rad(0), Rad(0))
- RH.C1 = CF(0.5 * PS, 1 * PS, 0 * PS) * angles(Rad(0), Rad(90), Rad(0)) * angles(Rad(0), Rad(0), Rad(0))
- LH.C1 = CF(-0.5 * PS, 1 * PS, 0 * PS) * angles(Rad(0), Rad(-90), Rad(0)) * angles(Rad(0), Rad(0), Rad(0))
- ----Animation and stuff----
- while true do
- swait()
- ----Player Look Change----
- ----Animations----
- sine = sine + change
- local torvel = (root.Velocity * Vector3.new(1, 0, 1)).magnitude
- local velderp = root.Velocity.y
- hitfloor, posfloor = rayCast(root.Position, CFrame.new(root.Position, root.Position - Vector3.new(0, 1, 0)).lookVector, 4* PS, char)
- if hitfloor == nil then
- cankick = true
- else
- cankick = false
- end
- if attack == false then
- idle = idle + 1
- else
- idle = 0
- end
- if 1 < root.Velocity.y and hitfloor == nil then
- Anim = "Jump"
- if attack == false then
- Hum.CameraOffset = Hum.CameraOffset:lerp(Vector3.new(0,0,0),0.15)
- rootj.C0 = clerp(rootj.C0, RootCF * CF(0* PS, 0* PS, -0.1 + 0.1 * Cos(sine / 20)* PS) * angles(Rad(-16), Rad(0), Rad(0)), 0.15)
- RH.C0 = clerp(RH.C0, CF(1* PS, -.2 - 0.1 * Cos(sine / 20)* PS, -.3* PS) * RHCF * angles(Rad(-1.5), Rad(0), Rad(0)), 0.15)
- LH.C0 = clerp(LH.C0, CF(-1* PS, -.9 - 0.1 * Cos(sine / 20), -0.5* PS) * LHCF * angles(Rad(-1.5), Rad(0), Rad(0)), 0.15)
- RW.C0 = clerp(RW.C0, CF(1.5* PS, 0.5 + 0.02 * Sin(sine / 20)* PS, 0* PS) * angles(Rad(25), Rad(-0.6), Rad(13 + 4.5 * Sin(sine / 20))), 0.1)
- LW.C0 = clerp(LW.C0, CF(-1.5* PS, 0.5 + 0.02 * Sin(sine / 20)* PS, 0* PS) * angles(Rad(25), Rad(-0.6), Rad(-13 - 4.5 * Sin(sine / 20))), 0.1)
- end
- elseif -1 > root.Velocity.y and hitfloor == nil then
- Anim = "Fall"
- if attack == false then
- Hum.CameraOffset = Hum.CameraOffset:lerp(Vector3.new(0,0,0),0.15)
- rootj.C0 = clerp(rootj.C0, RootCF * CF(0* PS, 0* PS, -0.1 + 0.1 * Cos(sine / 20)* PS) * angles(Rad(24), Rad(0), Rad(0)), 0.15)
- RH.C0 = clerp(RH.C0, CF(1* PS, -1 - 0.1 * Cos(sine / 20)* PS, -0.2* PS) * RHCF * angles(Rad(-6), Rad(0), Rad(0)), 0.3)
- LH.C0 = clerp(LH.C0, CF(-1* PS, -1 - 0.1 * Cos(sine / 20)* PS, -0.4* PS) * LHCF * angles(Rad(-5), Rad(0), Rad(0)), 0.11)
- RW.C0 = clerp(RW.C0, CF(1.5* PS, 0.5 + 0.02 * Sin(sine / 20)* PS, 0* PS) * angles(Rad(64), Rad(-.3), Rad(41 + 4* Sin(sine / 2))), 0.1)
- LW.C0 = clerp(LW.C0, CF(-1.5* PS, 0.5 + 0.02 * Sin(sine / 20)* PS, 0* PS) * angles(Rad(53), Rad(-.5), Rad(-43 - 4 * Sin(sine / 32))), 0.1)
- end
- elseif torvel < 1 and hitfloor ~= nil then
- Anim = "Idle"
- change = 1
- if attack == false then
- Hum.CameraOffset = Hum.CameraOffset:lerp(Vector3.new(0,0,0),0.15)
- rootj.C0 = clerp(rootj.C0, RootCF * CF(0* PS, 0* PS, 0* PS * Cos(sine / 15)) * angles(Rad(0), Rad(0), Rad(0)), 0.1)
- RH.C0 = clerp(RH.C0, CF(1* PS, -1 - 0 * Cos(sine / 15)* PS, 0* PS) * angles(Rad(0), Rad(90), Rad(0)) * angles(Rad(-1), Rad(0), Rad(0)), 0.1)
- LH.C0 = clerp(LH.C0, CF(-1* PS, -1 - 0 * Cos(sine / 15)* PS, 0* PS) * angles(Rad(0), Rad(-90), Rad(0)) * angles(Rad(-1), Rad(0), Rad(0)), 0.1)
- RW.C0 = clerp(RW.C0, CF(1.5* PS, 0.5 + 0 * Sin(sine / 14)* PS, 0* PS) * angles(Rad(0), Rad(1 + 1 * Sin(sine / 12)), Rad(1 + 2 * Sin(sine / 12))), 0.1)
- LW.C0 = clerp(LW.C0, CF(-1.5* PS, 0.5 + 0 * Sin(sine / 14)* PS, 0* PS) * angles(Rad(0), Rad(1 - 1 * Sin(sine / 12)), Rad(-1 - 2 * Sin(sine / 12))), 0.1)
- end
- elseif torvel > 2 and torvel < 22 and hitfloor ~= nil then
- Anim = "Walk"
- change = 1
- if attack == false then
- Hum.CameraOffset = Hum.CameraOffset:lerp(Vector3.new(0,0,0),0.15)
- rootj.C0 = clerp(rootj.C0, RootCF * CF(0* PS, 0* PS, -0.175 + 0.025 * Cos(sine / 3.5) + -Sin(sine / 3.5) / 7* PS) * angles(Rad(3 - 2.5 * Cos(sine / 3.5)), Rad(0) - root.RotVelocity.Y / 75, Rad(8 * Cos(sine / 7))), 0.15)
- RH.C0 = clerp(RH.C0, CF(1* PS, -0.8 - 0.5 * Cos(sine / 7) / 2* PS, 0.6 * Cos(sine / 7) / 2* PS) * angles(Rad(-15 - 15 * Cos(sine / 7)) - RL.RotVelocity.Y / 75 + -Sin(sine / 7) / 2.5, Rad(90 - 0 * Cos(sine / 7)), Rad(0)) * angles(Rad(0 + 1 * Cos(sine / 7)), Rad(0), Rad(0)), 0.3)
- LH.C0 = clerp(LH.C0, CF(-1* PS, -0.8 + 0.5 * Cos(sine / 7) / 2* PS, -0.6 * Cos(sine / 7) / 2* PS) * angles(Rad(-15 + 15 * Cos(sine / 7)) + LL.RotVelocity.Y / 75 + Sin(sine / 7) / 2.5, Rad(-90 - 0 * Cos(sine / 7)), Rad(0)) * angles(Rad(0 - 1 * Cos(sine / 7)), Rad(0), Rad(0)), 0.3)
- RW.C0 = clerp(RW.C0, CF(1.5* PS, 0.5 + 0.05 * Sin(sine / 7)* PS, 0* PS) * angles(Rad(56) * Cos(sine / 7) , Rad(20 * Cos(sine / 7)), Rad(6) - RA.RotVelocity.Y / 75), 0.1)
- LW.C0 = clerp(LW.C0, CF(-1.5* PS, 0.5 + 0.05 * Sin(sine / 7)* PS, 0* PS) * angles(Rad(-56) * Cos(sine / 7) , Rad(20 * Cos(sine / 7)) , Rad(-6) + LA.RotVelocity.Y / 75), 0.1)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement