Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script.Parent = owner.Character
- 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
- local RealPlayer = Player
- do print("hi")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
- --mc chicken tho...--
- --by youngmacka123--
- --cluckle cluckle--
- plr = owner
- char = plr.Character
- tors = char.Torso
- ra = char["Right Arm"]
- la = char["Left Arm"]
- rl = char["Right Leg"]
- ll = char["Left Leg"]
- hed = char.Head
- root = char.HumanoidRootPart
- hum = char.Humanoid
- sc = 0.75
- if hum.RigType == Enum.HumanoidRigType.R6 then
- hum.HipHeight = -1.3/sc
- elseif hum.RigType == Enum.HumanoidRigType.R15 then
- hum.HipHeight = 1
- end
- ezweld = function(p, a, b, cf)
- local weld = Instance.new("Weld",p)
- weld.Part0 = a
- weld.Part1 = b
- weld.C0 = cf
- return weld
- end
- clerp = function(toclerp, cf, number)
- local joint = toclerp
- joint.C0 = joint.C0:Lerp(cf, number)
- end
- clerp2 = function(toclerp, cf)
- local joint = toclerp
- joint.C0 = cf
- end
- clerp3 = function(toclerp, cf, number)
- local joint = toclerp
- joint.C1 = joint.C1:Lerp(cf, number)
- end
- Swait,swait = function(number)
- if number == 0 or number == nil then
- game:GetService("RunService").Heartbeat:Wait()
- else
- for i = 1,number do
- game:GetService("RunService").Heartbeat:Wait()
- end
- end
- end
- ezdecal = function(p, txt, tr, f)
- local decal = Instance.new("Decal", p)
- decal.Texture = "rbxassetid://" ..txt
- decal.Transparency = tr
- decal.Face = f
- return decal
- end
- for i,v in pairs (char:GetDescendants()) do
- if v:IsA("Hat") or v:IsA("Accessory") or v:IsA("Decal") or v:IsA("Texture") then
- v:remove()
- end
- if v:IsA("Part") then
- local mesh = Instance.new("SpecialMesh",v)
- mesh.Scale = Vector3.new(0, 0, 0)
- if v.Name ~= "Head" then
- v.Transparency = 1
- end
- end
- end
- IT = Instance.new
- Rad = math.rad
- Cos = math.cos
- Sin = math.sin
- C3 = Color3.new
- VT = Vector3.new
- --head
- local fhed = Instance.new("Part",char)
- fhed.Size = Vector3.new(1.2, 1.8, 0.76)*sc
- fhed.Color = Color3.new(0, 0, 0)
- fhed.CanCollide = false
- local decal = ezdecal(fhed, 127446043, 0, "Left")
- local decal = ezdecal(fhed, 127446043, 0, "Right")
- local decal = ezdecal(fhed, 127445969, 0, "Top")
- local decal = ezdecal(fhed, 127446043, 0, "Bottom")
- local decal = ezdecal(fhed, 127446043, 0, "Back")
- local decal = ezdecal(fhed, 127445889, 0, "Front")
- local weld = ezweld(char, fhed, hed, CFrame.new(0*sc, 0 + 0.05*sc, 0*sc) * CFrame.Angles(0, Rad(0), 0))
- local part = Instance.new("Part",char)
- part.Size = Vector3.new(1.23, 0.55, 0.6)*sc
- part.Color = Color3.new(0, 0, 0)
- part.CanCollide = false
- local decal = ezdecal(part, 127446345, 0, "Left")
- local decal = ezdecal(part, 127446345, 0, "Right")
- local decal = ezdecal(part, 127446429, 0, "Top")
- local decal = ezdecal(part, 127446400, 0, "Bottom")
- local decal = ezdecal(part, 127446400, 0, "Back")
- local decal = ezdecal(part, 127446345, 0, "Front")
- local weld = ezweld(char, part, hed, CFrame.new(0*sc, 0 + 0.05*sc, 0.67*sc) * CFrame.Angles(0, Rad(0), 0))
- --torso
- local ftors = Instance.new("Part",char)
- ftors.Size = Vector3.new(1.8, 2.4, 1.8)*sc
- ftors.Color = Color3.new(0, 0, 0)
- ftors.CanCollide = false
- local decal = ezdecal(ftors, 127447860, 0, "Left")
- local decal = ezdecal(ftors, 127446140, 0, "Right")
- local decal = ezdecal(ftors, 127446101, 0, "Top")
- local decal = ezdecal(ftors, 127446101, 0, "Bottom")
- local decal = ezdecal(ftors, 127447895, 0, "Back")
- local decal = ezdecal(ftors, 127447895, 0, "Front")
- local weld = ezweld(char, ftors, tors, CFrame.new(0*sc, 1.25*sc, -0.7*sc) * CFrame.Angles(Rad(90), Rad(0), 0))
- --right arm
- local part = Instance.new("Part",char)
- part.Size = Vector3.new(0.4, 1.16, 1.82)*sc
- part.Color = Color3.new(0, 0, 0)
- part.CanCollide = false
- local decal = ezdecal(part, 127446140, 0, "Left")
- local decal = ezdecal(part, 127447860, 0, "Right")
- local decal = ezdecal(part, 127447929, 0, "Top")
- local decal = ezdecal(part, 127447929, 0, "Bottom")
- local decal = ezdecal(part, 127446140, 0, "Back")
- local decal = ezdecal(part, 127446140, 0, "Front")
- local weld = ezweld(char, part, ra, CFrame.new(0.9*sc, -1.025*sc, -1.25*sc) * CFrame.Angles(Rad(0), Rad(0), 0))
- --left arm
- local part = Instance.new("Part",char)
- part.Size = Vector3.new(0.4, 1.16, 1.82)*sc
- part.Color = Color3.new(0, 0, 0)
- part.CanCollide = false
- local decal = ezdecal(part, 127446140, 0, "Left")
- local decal = ezdecal(part, 127447860, 0, "Right")
- local decal = ezdecal(part, 127447929, 0, "Top")
- local decal = ezdecal(part, 127447929, 0, "Bottom")
- local decal = ezdecal(part, 127446140, 0, "Back")
- local decal = ezdecal(part, 127446140, 0, "Front")
- local weld = ezweld(char, part, la, CFrame.new(-0.9*sc, -1.025*sc, -1.25*sc) * CFrame.Angles(Rad(0), Rad(0), 0))
- --right leg
- local part = Instance.new("Part",char)
- part.Size = Vector3.new(0.1, 0.1, 0.1)
- part.Color = Color3.new(1, 1, 0)
- part.CanCollide = false
- local mesh = Instance.new("SpecialMesh",part)
- mesh.MeshId = "rbxassetid://4593733202"
- mesh.TextureId = "rbxassetid://127446608"
- mesh.Scale = Vector3.new(1, 1, 1)*sc
- mesh.Offset = Vector3.new(0, 0, 0)*sc
- local weld1 = ezweld(char, part, rl, CFrame.new(-0.3*sc, -1.675*sc, 0.65*sc) * CFrame.Angles(Rad(0), Rad(180), 0))
- weld1nor = weld1.C0
- --left leg
- local part = Instance.new("Part",char)
- part.Size = Vector3.new(0.1, 0.1, 0.1)
- part.Color = Color3.new(1, 1, 0)
- part.CanCollide = false
- local mesh = Instance.new("SpecialMesh",part)
- mesh.MeshId = "rbxassetid://4593733202"
- mesh.TextureId = "rbxassetid://127446608"
- mesh.Scale = Vector3.new(1, 1, 1)*sc
- mesh.Offset = Vector3.new(0, 0, 0)*sc
- local weld2 = ezweld(char, part, ll, CFrame.new(0.3*sc, -1.675*sc, 0.625*sc) * CFrame.Angles(Rad(0), Rad(180), 0))
- weld2nor = weld2.C0
- anim = "Idle"
- attack = false
- local RS = char.Torso["Right Shoulder"]
- local LS = char.Torso["Left Shoulder"]
- local RH = char.Torso["Right Hip"]
- local LH = char.Torso["Left Hip"]
- local neck = char.Torso["Neck"]
- local root = char.HumanoidRootPart
- local rootj = root.RootJoint
- local sine = 0
- local RSnor = RS.C0
- local LSnor = LS.C0
- local RHnor = RH.C0
- local LHnor = LH.C0
- local RSnor2 = RS.C1
- local LSnor2 = LS.C1
- local RHnor2 = RH.C1
- local LHnor2 = LH.C1
- local necknor2 = neck.C1
- local rootjnor2 = rootj.C1
- local rootjnor = rootj.C0
- local necknor = neck.C0
- local tors = char.Torso
- hum.Animator:remove()
- mouse = plr:GetMouse()
- hold = false
- Debris = game:GetService("Debris")
- sine = 0
- script.Parent = char
- function findNearestTorso(pos)
- local list = workspace:children()
- local torso = nil
- local dist = 20
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) and (temp2 ~= char) then
- temp = temp2:findFirstChild("Head")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- local near = findNearestTorso(root.Position)
- local GYRO = Instance.new("BodyGyro")
- GYRO.D = 20
- GYRO.P = 5000
- GYRO.MaxTorque = VT(0,40000000000,0)
- GYRO.CFrame = CFrame.new(root.Position,root.Position)
- if near then
- GYRO.CFrame = CFrame.new(root.Position, near.Position)
- end
- GYRO.Parent = char
- local float = Instance.new("BodyVelocity", nil)
- float.MaxForce = Vector3.new(0, math.huge, 0)
- float.Velocity = Vector3.new(0, -5, 0)
- function RayCast(Position, Direction, Range, Ignore)
- return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
- end
- function flap()
- attack = true
- float.Parent = root
- local yay = Instance.new("NumberValue", char)
- yay.Name = "yay"
- local fallTime = 0
- local touchie = root.Touched:connect(function(hit)
- local dud = hit.Parent
- if dud and dud ~= char then
- yay:remove()
- end
- end)
- repeat
- Swait()
- clerp(RS, RSnor * CFrame.Angles(Rad(-90 - 25 * Sin(sine / 6)), Rad(0), Rad(0)) * CFrame.new(0, -0.25, 0.5), 0.3)
- clerp(LS, LSnor * CFrame.Angles(Rad(-90 - 25 * Sin(sine / 6)), Rad(0), Rad(0)) * CFrame.new(0, -0.25, 0.5), 0.3)
- clerp(rootj, rootjnor * CFrame.Angles(Rad(0), 0, Rad(0)), 0.5)
- if near == nil then
- clerp(neck, necknor, 0.3)
- end
- clerp(RH, RHnor, 0.3)
- clerp(LH, LHnor, 0.3)
- until yay.Parent ~= char
- yay = nil
- local yay = nil
- float.Parent = nil
- attack = false
- end
- Swait(10)
- function eggieso(cf)
- local c = false
- local eg = Instance.new("Part", char)
- eg.CFrame = cf
- eg.CanCollide = false
- eg.Anchored = true
- eg.Size = Vector3.new(1, 1, 1)
- local mesh = Instance.new("SpecialMesh", eg)
- mesh.MeshId = "rbxassetid://4594401408"
- local egcf = eg.CFrame
- local spin = 0
- eg.Touched:connect(function(hit)
- local dud = hit.Parent
- local torso = dud:FindFirstChild("Torso") or dud:FindFirstChild("UpperTorso")
- if dud and dud ~= char and dud:FindFirstChildOfClass("Humanoid") and c == false and torso then
- c = true
- eg.Parent = script
- for i = 1,11 do
- Swait()
- eg.Anchored = true
- eg.CFrame = eg.CFrame:lerp(CFrame.new(torso.CFrame.x, torso.CFrame.y, torso.CFrame.z), 0.55)
- end
- local tool = Instance.new("Tool", dud)
- tool.Name = "egg"
- local handle = eg
- handle.Name = "Handle"
- handle.Anchored = false
- mesh.Scale = Vector3.new(1.5, 1.5, 1.5)
- handle.Parent = tool
- tool.Activated:connect(function()
- handle.Name = "flyingegg!!"
- handle.Parent = workspace
- handle.Velocity = handle.CFrame.lookVector * 165 + Vector3.new(0, 35, 0)
- handle.Touched:connect(function(hit)
- if hit.Parent and hit.Parent ~= tool.Parent then
- --handle:remove()
- end
- end)
- Debris:AddItem(tool, 3)
- end)
- return eg, tool
- end
- end)
- coroutine.resume(coroutine.create(function()
- repeat
- Swait()
- spin = spin + Rad(1)
- eg.CFrame = egcf * CFrame.new(0, 0 + 0.25 * Sin(sine / 12), 0) * CFrame.Angles(0, spin, 0)
- until eg.Parent ~= char
- end))
- return eg
- end
- function egg()
- local c = false
- local eg = Instance.new("Part", char)
- eg.CFrame = CFrame.new(ftors.CFrame.x, ftors.CFrame.y, ftors.CFrame.z)
- eg.CanCollide = false
- eg.Anchored = true
- eg.Size = Vector3.new(1, 1, 1)
- local mesh = Instance.new("SpecialMesh", eg)
- mesh.MeshId = "rbxassetid://4594401408"
- local egcf = eg.CFrame
- local spin = 0
- eg.Touched:connect(function(hit)
- local dud = hit.Parent
- local torso = dud:FindFirstChild("Torso") or dud:FindFirstChild("UpperTorso")
- if dud and dud ~= char and dud:FindFirstChildOfClass("Humanoid") and c == false and torso then
- c = true
- eg.Parent = script
- for i = 1,11 do
- Swait()
- eg.Anchored = true
- eg.CFrame = eg.CFrame:lerp(CFrame.new(torso.CFrame.x, torso.CFrame.y, torso.CFrame.z), 0.55)
- end
- local tool = Instance.new("Tool", dud)
- tool.Name = "egg"
- local handle = eg
- handle.Name = "Handle"
- handle.Anchored = false
- mesh.Scale = Vector3.new(1.5, 1.5, 1.5)
- handle.Parent = tool
- tool.Changed:connect(function(changed)
- if changed == "Parent" and tool.Parent == workspace then
- Swait()
- local oldpos = handle.CFrame * CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, -1.75, 0.5)
- local egg,tool = eggieso(oldpos)
- eg:remove()
- elseif changed == "Name" then
- tool.Name = "egg"
- end
- end)
- tool.Activated:connect(function()
- handle.Name = "flyingegg!!"
- handle.Parent = workspace
- handle.Velocity = handle.CFrame.lookVector * 165 + Vector3.new(0, 35, 0)
- handle.Touched:connect(function(hit)
- if hit.Parent and hit.Parent ~= tool.Parent then
- --handle:remove()
- end
- end)
- Debris:AddItem(tool, 3)
- end)
- end
- end)
- coroutine.resume(coroutine.create(function()
- repeat
- Swait()
- spin = spin + Rad(1)
- eg.CFrame = egcf * CFrame.new(0, 0 + 0.25 * Sin(sine / 12), 0) * CFrame.Angles(0, spin, 0)
- until eg.Parent ~= char
- end))
- end
- mouse.KeyDown:connect(function(key)
- if key == "e" then
- egg()
- end
- end)
- while true do
- Swait()
- sine = sine + 1
- if root.Velocity.Y <= -55 then
- coroutine.resume(coroutine.create(function()
- flap()
- end))
- end
- hum.WalkSpeed = 16
- torsvel = (root.Velocity * VT(1, 0, 1)).magnitude
- local near = findNearestTorso(root.Position)
- if near ~= nil then
- local pos = near.CFrame.p
- GYRO.Parent = root
- GYRO.CFrame = CFrame.new(root.Position, pos)
- root.Anchored = false
- local _, Point = workspace:FindPartOnRay(Ray.new(fhed.CFrame.p, near.CFrame.lookVector), workspace, false, true)
- Dist = (fhed.CFrame.p-Point).magnitude
- Diff = fhed.CFrame.Y-Point.Y
- neck.C0 = necknor*CFrame.Angles((math.tan(Diff/Dist)*0.75), 0, (((fhed.CFrame.p-Point).Unit):Cross(ftors.CFrame.lookVector)).Y*0.75)
- else
- GYRO.Parent = nil
- root.Anchored = false
- hed.Anchored = false
- end
- if torsvel < 1 then
- anim = "Idle"
- if attack == false then
- clerp(RS, RSnor * CFrame.Angles(Rad(0), Rad(0), Rad(0)) * CFrame.new(0, 0, 0), 0.3)
- clerp(LS, LSnor * CFrame.Angles(Rad(0), Rad(0), Rad(0)) * CFrame.new(0, 0, 0), 0.3)
- clerp(rootj, rootjnor * CFrame.Angles(Rad(0), 0, Rad(0)), 0.5)
- if near == nil then
- clerp(neck, necknor, 0.3)
- end
- clerp(RH, RHnor, 0.3)
- clerp(LH, LHnor, 0.3)
- end
- elseif torsvel > 1 then
- anim = "Walk"
- if attack == false then
- clerp(RS, RSnor * CFrame.Angles(Rad(0), Rad(0), Rad(0)) * CFrame.new(0, 0, 0), 0.3)
- clerp(LS, LSnor * CFrame.Angles(Rad(0), Rad(0), Rad(0)) * CFrame.new(0, 0, 0), 0.3)
- clerp(rootj, rootjnor * CFrame.Angles(Rad(0), 0, Rad(0)), 0.5)
- if near == nil then
- clerp(neck, necknor, 0.3)
- end
- clerp(RH, RHnor, 0.3)
- clerp(LH, LHnor, 0.3)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement