Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This script has been converted to FE by iPxter
- 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
- warn([[ Created by Guestpiki
- If you leak you're a skid.
- actions.
- WARNING: This is not a finished project, so please. Don't Hate (THIS SCRIPT ISN'T A BOOTLEG, COPY OR INSPIRATION OF "Old Nostalgia Robloxian" THIS SCRIPT WAS MADE TO TEST MY SCRIPTING SKILLS)
- e - Explosion
- p - Sprint
- m - Walk
- n - Run
- f - Pie
- b - Just try it.
- n - Run
- v - Time Bomb
- t,y,u,g,h - Sound change ]])
- local Player = owner.Character
- local Tool = Instance.new("Tool",owner.Backpack)
- Tool.CanBeDropped = false
- Tool.TextureId = "rbxassetid://3114850474"
- local Handle = Instance.new("Part",Tool)
- Handle.Name = "Handle"
- Handle.Size = Vector3.new(1, 1, 1)
- local HandleMesh = Instance.new("SpecialMesh",Handle)
- HandleMesh.MeshType = "FileMesh"
- HandleMesh.MeshId = "http://www.roblox.com/asset/?id=10470609"
- HandleMesh.TextureId = "rbxassetid://3112215570"
- enabled = true
- local ff = Instance.new("ForceField",Player)
- ff.Visible = false
- function onActivated()
- if not enabled then
- return
- end
- enabled = false
- Tool.GripForward = Vector3.new(0,-.759,-.651)
- Tool.GripPos = Vector3.new(1.5,-.5,.3)
- Tool.GripRight = Vector3.new(1,0,0)
- Tool.GripUp = Vector3.new(0,.651,-.759)
- wait(3)
- local h = Tool.Parent:FindFirstChild("Humanoid")
- h.Health = "inf"
- h.MaxHealth = "inf"
- if h.Health == 0 then
- h.Health = "inf"
- end
- Tool.GripForward = Vector3.new(-.976,0,-0.217)
- Tool.GripPos = Vector3.new(0.03,0,0)
- Tool.GripRight = Vector3.new(.217,0,-.976)
- Tool.GripUp = Vector3.new(0,1,0)
- wait(1)
- Player.Head.face.Texture = "rbxassetid://152628662"
- local OHMYGOD = Instance.new("Sound",Player.Head)
- OHMYGOD.SoundId = "rbxassetid://363275751"
- OHMYGOD.Volume = 5
- OHMYGOD.TimePosition = 3
- OHMYGOD.Playing = true
- wait(4)
- Player.Head.face.Texture = "rbxassetid://168024772"
- wait(4)
- Player.Head.face.Texture = "rbxassetid://246990309"
- wait(5)
- OHMYGOD:Destroy()
- local OHMYGOD2 = Instance.new("Sound",Player.Head)
- OHMYGOD2.SoundId = "rbxassetid://907692445"
- OHMYGOD2.Volume = 2
- OHMYGOD2.Playing = true
- OHMYGOD2.TimePosition = 226
- OHMYGOD2.Looped = true
- Handle.Parent = workspace
- Handle.CanCollide = true
- Tool:Destroy()
- wait(5)
- Handle:Destroy()
- local gui = Instance.new("BillboardGui", Player)
- gui.Adornee = Player.Head
- gui.Name = "_status"
- gui.Size = UDim2.new(2, 0, 1.2, 0)
- gui.StudsOffset = Vector3.new(-9, 8, 0)
- local text = Instance.new("TextLabel", gui)
- text.Size = UDim2.new(10, 0, 7, 0)
- text.FontSize = "Size24"
- text.TextScaled = false
- text.TextTransparency = 0
- text.BackgroundTransparency = 1
- text.TextTransparency = 0
- text.TextStrokeTransparency = 1
- text.Font = "Cartoon"
- text.TextColor3 = Color3.fromRGB(255, 255, 255)
- text.TextStrokeColor3 = Color3.new(0, 0, 0)
- text.Text = "Nostalgia Noob"
- text.TextTransparency = 1
- text.TextStrokeTransparency = 1
- wait(0.05)
- text.TextTransparency = .9
- text.TextStrokeTransparency = .9
- wait(0.05)
- text.TextTransparency = .8
- text.TextStrokeTransparency = .8
- wait(0.05)
- text.TextTransparency = .7
- text.TextStrokeTransparency = .7
- wait(0.05)
- text.TextTransparency = .6
- text.TextStrokeTransparency = .6
- wait(0.05)
- text.TextTransparency = .5
- text.TextStrokeTransparency = .5
- wait(0.05)
- text.TextTransparency = .4
- text.TextStrokeTransparency = .4
- wait(0.05)
- text.TextTransparency = .3
- text.TextStrokeTransparency = .3
- wait(0.05)
- text.TextTransparency = .2
- text.TextStrokeTransparency = .2
- wait(0.05)
- text.TextTransparency = .1
- text.TextStrokeTransparency = .1
- wait(0.05)
- text.TextTransparency = 0
- text.TextStrokeTransparency = 0
- wait(0.05)
- for i,v in pairs(Player:children()) do
- if v:IsA("CharacterMesh") then
- v:Destroy()
- end
- end
- Player["Body Colors"].HeadColor3 = Color3.fromRGB(245, 205, 48)
- Player["Body Colors"].LeftArmColor3 = Color3.fromRGB(245, 205, 48)
- Player["Body Colors"].RightArmColor3 = Color3.fromRGB(245, 205, 48)
- Player["Body Colors"].LeftLegColor3 = Color3.fromRGB(164, 189, 71)
- Player["Body Colors"].RightLegColor3 = Color3.fromRGB(164, 189, 71)
- Player["Body Colors"].TorsoColor3 = Color3.fromRGB(13, 105, 172)
- Player.Head.Mesh.MeshId = "rbxassetid://1068249467"
- Player.Head.face.Texture = "rbxassetid://986751626"
- local OHMYGOD3 = Instance.new("Sound",Player.Head)
- OHMYGOD3.Name = "FirstSound"
- OHMYGOD2:Destroy()
- OHMYGOD3.SoundId = "rbxassetid://411946428"
- OHMYGOD3.Volume = 10
- OHMYGOD3.Playing = true
- OHMYGOD3.Looped = true
- mouse.Icon = "rbxassetid://172802980"
- Player.Head.Climbing:Destroy()
- Player.Head.FreeFalling:Destroy()
- Player.Head.GettingUp.SoundId = "rbxassetid://12222046"
- Player.Head.GettingUp.Volume = 10
- Player.Head.Splash:Destroy()
- Player.Head.Landing:Destroy()
- Player.Head.Swimming:Destroy()
- Player.Head.Running.SoundId = "rbxassetid://174960816"
- Player.Head.Running.Volume = 10
- Player.Head.Running.PlaybackSpeed = 1
- Player.Head.Jumping.SoundId = "rbxassetid://12222200"
- Player.Head.Jumping.Volume = 10
- for i,v in pairs(Player:children()) do
- if v:IsA("Accessory") then
- v:Destroy()
- end
- end
- for i,v in pairs(Player:children()) do
- if v:IsA("CharacterMesh") then
- v:Destroy()
- end
- end
- for i,v in pairs(Player:children()) do
- if v:IsA("Shirt") then
- v.ShirtTemplate = "rbxassetid://1110695025"
- end
- end
- for i,v in pairs(Player:children()) do
- if v:IsA("Pants") then
- v.PantsTemplate = "rbxassetid://1110798365"
- end
- end
- for i,v in pairs(Player:children()) do
- if v:IsA("ShirtGraphic") then
- v.Graphic = "rbxassetid://1466794520"
- end
- end
- local Shirt = Instance.new("Shirt",Player)
- Shirt.ShirtTemplate = "rbxassetid://1110695025"
- local Pants = Instance.new("Pants",Player)
- Pants.PantsTemplate = "rbxassetid://1110798365"
- local TShirt = Instance.new("ShirtGraphic",Player)
- TShirt.Graphic = "rbxassetid://1466794520"
- mouse.Icon = "rbxassetid://172802980"
- local sky = Instance.new("Sky",game.Lighting)
- sky.CelestialBodiesShown = true
- sky.SkyboxBk = "http://www.roblox.com/asset/?id=15436783"
- sky.SkyboxDn = "http://www.roblox.com/asset/?id=15436796"
- sky.SkyboxFt = "http://www.roblox.com/asset/?id=15436831"
- sky.SkyboxLf = "http://www.roblox.com/asset/?id=15437157"
- sky.SkyboxRt = "http://www.roblox.com/asset/?id=15437166"
- sky.SkyboxUp = "http://www.roblox.com/asset/?id=15437184"
- local Light = game.Lighting
- Light.Ambient = Color3.fromRGB(255,255,255)
- Light.OutdoorAmbient = Color3.fromRGB(255,255,255)
- Light.Brightness = 0
- Light.GlobalShadows = false
- print("Testing.")
- function Bomb()
- local Plant = Instance.new("Part",workspace)
- Plant.Shape = "Ball"
- Plant.Reflectance = .85
- Plant.BrickColor = BrickColor.Blue()
- Plant.Size = Vector3.new(2,2,2)
- Plant.Anchored = false
- Plant.Position = Player.Head.Position
- Plant.TopSurface = "Smooth"
- Plant.BottomSurface = "Smooth"
- wait()
- Plant.BrickColor = BrickColor.Red()
- local ticck = Instance.new("Sound",Plant)
- ticck.SoundId = "rbxassetid://12221976"
- ticck:Play()
- ticck.Volume = 50
- wait(1)
- Plant.BrickColor = BrickColor.Black()
- ticck:Play()
- wait(0.9)
- Plant.BrickColor = BrickColor.Red()
- ticck:Play()
- wait(0.8)
- Plant.BrickColor = BrickColor.Black()
- ticck:Play()
- wait(0.7)
- Plant.BrickColor = BrickColor.Red()
- ticck:Play()
- wait(0.6)
- Plant.BrickColor = BrickColor.Black()
- ticck:Play()
- wait(0.5)
- Plant.BrickColor = BrickColor.Red()
- ticck:Play()
- wait(0.4)
- Plant.BrickColor = BrickColor.Black()
- ticck:Play()
- wait(0.3)
- Plant.BrickColor = BrickColor.Red()
- ticck:Play()
- wait(0.2)
- Plant.BrickColor = BrickColor.Black()
- ticck:Play()
- wait(0.1)
- Plant.BrickColor = BrickColor.Red()
- ticck:Play()
- wait(0)
- Plant.BrickColor = BrickColor.Black()
- ticck:Play()
- wait(0)
- Plant.BrickColor = BrickColor.Red()
- ticck:Play()
- wait(0)
- Plant.BrickColor = BrickColor.Black()
- ticck:Play()
- local ExSound = Instance.new("Sound",Plant)
- ExSound.SoundId = "rbxassetid://12222084"
- ExSound.Parent = Plant
- ExSound.Volume = 50
- ExSound:play()
- local explosion = Instance.new("Explosion",workspace)
- explosion.BlastPressure = 500000
- explosion.BlastRadius = 4
- explosion.DestroyJointRadiusPercent = 30
- explosion.ExplosionType = "Craters"
- explosion.Visible = false
- local ClassicExplosion = Instance.new("Part")
- ClassicExplosion.Parent = workspace
- ClassicExplosion.Anchored = true
- ClassicExplosion.Shape = "Ball"
- ClassicExplosion.Color = Color3.new(1,0,0)
- ClassicExplosion.Size = Vector3.new(20,20,20)
- ClassicExplosion.Name = "Explosion"
- ClassicExplosion.BottomSurface = "Smooth"
- ClassicExplosion.TopSurface = "Smooth"
- ClassicExplosion.Material = "Neon"
- ClassicExplosion.Position = Plant.Position
- ClassicExplosion.CanCollide = false
- ClassicExplosion.CastShadow = false
- Plant:Destroy()
- wait(0.2)
- ClassicExplosion:Destroy()
- wait(5)
- ExSound:Destroy()
- end
- function Explosionshaha()
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxasset://sounds\\Rocket shot.wav"
- sound.Parent = script.Parent
- sound.Volume = 10
- sound:play()
- local explosion = Instance.new("Explosion",workspace)
- explosion.BlastPressure = 500000
- explosion.BlastRadius = 4
- explosion.DestroyJointRadiusPercent = 30
- explosion.ExplosionType = "Craters"
- explosion.Visible = false
- local ClassicExplosion = Instance.new("Part")
- ClassicExplosion.Parent = explosion
- ClassicExplosion.Anchored = true
- ClassicExplosion.Shape = "Ball"
- ClassicExplosion.Color = Color3.new(1,0,0)
- ClassicExplosion.Size = Vector3.new(20,20,20)
- ClassicExplosion.Name = "Explosion"
- ClassicExplosion.BottomSurface = "Smooth"
- ClassicExplosion.TopSurface = "Smooth"
- ClassicExplosion.Material = "Neon"
- ClassicExplosion.Position = Player.Torso.Position
- ClassicExplosion.CanCollide = false
- ClassicExplosion.CastShadow = false
- wait(0.2)
- ClassicExplosion:Destroy()
- wait(5)
- sound:Destroy()
- end
- function Sprint()
- print("Sprinting")
- h.WalkSpeed = 100
- end
- function Walk()
- print("Walking")
- h.WalkSpeed = 16
- end
- function Run()
- print("Running")
- h.WalkSpeed = 50
- end
- function pie()
- print("Oops I totally didn't copy this from Meme Animations ;)")
- h.WalkSpeed = 0
- local piesound = Instance.new("Sound", Player.Head)
- piesound.SoundId = "rbxassetid://252252871"
- piesound.Playing = true
- piesound.Volume = 10
- wait(0.79)
- Player.Humanoid.Jump = true
- wait(1.35)
- local PieTool = Instance.new("Tool",Player)
- PieTool.CanBeDropped = false
- PieTool.TextureId = "rbxassetid://3114850880"
- local PieHandle = Instance.new("Part",PieTool)
- PieHandle.Name = "Handle"
- PieHandle.Size = Vector3.new(2.2, 2.2, 2.2)
- local PieHandleMesh = Instance.new("SpecialMesh",PieHandle)
- PieHandleMesh.MeshType = "FileMesh"
- PieHandleMesh.MeshId = "rbxassetid://40312463"
- PieHandleMesh.TextureId = "rbxassetid://40311968"
- PieHandleMesh.Scale = Vector3.new(2.2, 2.2, 2.2)
- PieHandleMesh.Offset = Vector3.new(1.4, -.3, -1.5)
- PieHandle.Anchored = true
- PieHandle.Position = Player.Head.Position
- Player.Head.Anchored = true
- PieHandle.Orientation = Player["Head"].Orientation
- wait(2.5)
- local ClassicExplosion2 = Instance.new("Part")
- ClassicExplosion2.Parent = workspace
- ClassicExplosion2.Anchored = true
- ClassicExplosion2.Shape = "Ball"
- ClassicExplosion2.Color = Color3.new(1,0,0)
- ClassicExplosion2.Size = Vector3.new(20,20,20)
- ClassicExplosion2.Name = "Explosion"
- ClassicExplosion2.BottomSurface = "Smooth"
- ClassicExplosion2.TopSurface = "Smooth"
- ClassicExplosion2.Material = "Neon"
- ClassicExplosion2.Position = Player.Torso.Position
- ClassicExplosion2.CanCollide = false
- ClassicExplosion2.CastShadow = false
- wait(0.2)
- ClassicExplosion2:Destroy()
- wait(2)
- PieHandle.Anchored = false
- PieTool:Destroy()
- Player.Head.Anchored = false
- piesound:Destroy()
- h.WalkSpeed = 16
- end
- function BOOM()
- print("ur ded")
- Player.Head.face.Texture = "rbxassetid://3120305670"
- Player.Humanoid.PlatformStand = true
- local Snap = Instance.new("Sound",Player.Head)
- Snap.Name = "Snap"
- Snap.Volume = 10
- Snap.SoundId = "rbxassetid://12222140"
- Snap.Playing = true
- wait(0.257)
- Snap.SoundId = "rbxassetid://580806904"
- Snap.TimePosition = 0
- Snap.Playing = true
- wait(3.9735785386320685575)
- Player.Head.face.Texture = "rbxassetid://3120298750"
- wait(2)
- Player.Head.face.Texture = "rbxassetid://3120301544"
- wait(1)
- Player.Humanoid.PlatformStand = false
- Player.Humanoid.Jump = true
- h.WalkSpeed = 0
- Player.Torso["Left Hip"].CurrentAngle = 800
- Player.Torso["Left Hip"].MaxVelocity = 1.15
- Player.Torso["Left Shoulder"].CurrentAngle = 800
- Player.Torso["Left Shoulder"].MaxVelocity = 1.15
- Player.Torso["Right Hip"].CurrentAngle = 800
- Player.Torso["Right Hip"].MaxVelocity = 1.15
- Player.Torso["Right Shoulder"].CurrentAngle = 800
- Player.Torso["Right Shoulder"].MaxVelocity = 1.15
- Player.Torso.CFrame=Player.Torso.CFrame*CFrame.fromEulerAnglesXYZ(0,180,180)
- Player.HumanoidRootPart:Destroy()
- wait(9)
- ff:Destroy()
- Player.Head.face.Texture = "rbxassetid://3120305670"
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxasset://sounds\\Rocket shot.wav"
- sound.Parent = script.Parent
- sound.Volume = 1
- sound:play()
- h.Health = 0
- local explosion = Instance.new("Explosion",workspace)
- explosion.Visible = false
- local ClassicExplosion = Instance.new("Part")
- ClassicExplosion.Parent = explosion
- ClassicExplosion.Anchored = true
- ClassicExplosion.Shape = "Ball"
- ClassicExplosion.Color = Color3.new(1,0,0)
- ClassicExplosion.Size = Vector3.new(20,20,20)
- ClassicExplosion.Name = "Explosion"
- ClassicExplosion.BottomSurface = "Smooth"
- ClassicExplosion.TopSurface = "Smooth"
- ClassicExplosion.Material = "Neon"
- ClassicExplosion.Position = Player.Torso.Position
- ClassicExplosion.CanCollide = false
- ClassicExplosion.CastShadow = false
- OHMYGOD3.SoundId = "rbxassetid://1074233689"
- OHMYGOD3.TimePosition = 0
- OHMYGOD3.Looped = false
- wait(0.2)
- ClassicExplosion:Destroy()
- wait(5)
- sound:Destroy()
- mouse.Icon = ""
- end
- end
- function GottaBanBanBan()
- if owner.Name == "Guestpiki" then
- local BanHammer = Instance.new("Tool", owner.Backpack)
- BanHammer.GripForward = Vector3.new(0,0,1)
- BanHammer.GripPos = Vector3.new(0,-1.031,0.156)
- BanHammer.GripRight = Vector3.new(-1,0,0)
- BanHammer.GripUp = Vector3.new(0,1,0)
- BanHammer.Name = "Ban Hammer (Used for abusing.)"
- BanHammer.CanBeDropped = false
- local BanHandle = Instance.new("Part",BanHammer)
- BanHandle.Name = "Handle"
- BanHandle.Locked = true
- local BanMesh = Instance.new("SpecialMesh", BanHandle)
- BanMesh.MeshType = "FileMesh"
- BanMesh.Scale = Vector3.new(0.5,0.5,0.5)
- BanMesh.MeshId = "http://www.roblox.com/asset/?id=10604848"
- BanMesh.TextureId = "http://www.roblox.com/asset/?id=10605252"
- local banAnim = Instance.new("Animation", BanHammer)
- banAnim.AnimationId = "http://www.roblox.com/twohandswordwithswingout-item?id=32659706"
- BanHandle.Touched:connect(function(hit)
- local kickguy = game.Players:GetPlayerFromCharacter(hit.Parent)
- if kickguy then
- kickguy.Character.Head:Destroy()
- local OHSNAP = Instance.new("Sound",workspace)
- OHSNAP.SoundId = "rbxassetid://12221990"
- OHSNAP.Volume = "inf"
- OHSNAP:Play()
- end
- end)
- BanHammer.Activated:connect(function(click)
- Player.Humanoid:LoadAnimation(banAnim)
- end)
- else
- print("You're not the creator of the script!")
- end
- end
- function sit()
- Player.Humanoid.Sit = true
- end
- mouse.KeyDown:connect(function(key)
- if key == 'e' then
- Explosionshaha()
- elseif key == 'p' then
- Sprint()
- elseif key == "n" then
- Run()
- elseif key == 'm' then
- Walk()
- elseif key == "f" then
- pie()
- elseif key == "b" then
- BOOM()
- elseif key == "v" then
- Bomb()
- elseif key == "z" then
- GottaBanBanBan()
- elseif key == "u" then
- sit()
- end
- end)
- enabled = true
- function onEquipped()
- end
- Tool.Activated:connect(onActivated)
- Tool.Equipped:connect(onEquipped)
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- -- ANIMATION
- -- declarations
- local Figure = script.Parent
- local Torso = waitForChild(Figure, "Torso")
- local RightShoulder = waitForChild(Torso, "Right Shoulder")
- local LeftShoulder = waitForChild(Torso, "Left Shoulder")
- local RightHip = waitForChild(Torso, "Right Hip")
- local LeftHip = waitForChild(Torso, "Left Hip")
- local Neck = waitForChild(Torso, "Neck")
- local Humanoid = waitForChild(Figure, "Humanoid")
- local pose = "Standing"
- local toolAnim = "None"
- local toolAnimTime = 0
- local jumpMaxLimbVelocity = 0.75
- -- functions
- function onRunning(speed)
- if speed>0 then
- pose = "Running"
- else
- pose = "Standing"
- end
- end
- function onDied()
- pose = "Dead"
- end
- function onJumping()
- pose = "Jumping"
- end
- function onClimbing()
- pose = "Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- pose = "FreeFall"
- end
- function onFallingDown()
- pose = "FallingDown"
- end
- function onSeated()
- pose = "Seated"
- end
- function onPlatformStanding()
- pose = "PlatformStanding"
- end
- function onSwimming(speed)
- if speed>0 then
- pose = "Running"
- else
- pose = "Standing"
- end
- end
- function moveJump()
- RightShoulder.MaxVelocity = 0.4
- LeftShoulder.MaxVelocity = 0.4
- RightShoulder:SetDesiredAngle(3.14)
- LeftShoulder:SetDesiredAngle(-3.14)
- RightHip:SetDesiredAngle(0)
- LeftHip:SetDesiredAngle(0)
- wait(0.8)
- end
- -- same as jump for now
- function moveFreeFall()
- RightShoulder.MaxVelocity = 0.4
- LeftShoulder.MaxVelocity = 0.4
- RightShoulder:SetDesiredAngle(3.14)
- LeftShoulder:SetDesiredAngle(-3.14)
- RightHip:SetDesiredAngle(0)
- LeftHip:SetDesiredAngle(0)
- wait(0.8)
- end
- function moveSit()
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- RightShoulder:SetDesiredAngle(3.14 /2)
- LeftShoulder:SetDesiredAngle(-3.14 /2)
- RightHip:SetDesiredAngle(3.14 /2)
- LeftHip:SetDesiredAngle(-3.14 /2)
- end
- function getTool()
- for _, kid in ipairs(Figure:GetChildren()) do
- if kid.className == "Tool" then return kid end
- end
- return nil
- end
- function getToolAnim(tool)
- for _, c in ipairs(tool:GetChildren()) do
- if c.Name == "toolanim" and c.className == "StringValue" then
- return c
- end
- end
- return nil
- end
- function animateTool()
- if (toolAnim == "None") then
- RightShoulder:SetDesiredAngle(1.57)
- return
- end
- if (toolAnim == "Slash") then
- RightShoulder.MaxVelocity = 0.5
- RightShoulder:SetDesiredAngle(0)
- return
- end
- if (toolAnim == "Lunge") then
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightHip.MaxVelocity = 0.5
- LeftHip.MaxVelocity = 0.5
- RightShoulder:SetDesiredAngle(1.57)
- LeftShoulder:SetDesiredAngle(1.0)
- RightHip:SetDesiredAngle(1.57)
- LeftHip:SetDesiredAngle(1.0)
- return
- end
- end
- function move(time)
- local amplitude
- local frequency
- if (pose == "Jumping") then
- moveJump()
- return
- end
- if (pose == "FreeFall") then
- moveFreeFall()
- return
- end
- if (pose == "Seated") then
- moveSit()
- return
- end
- local climbFudge = 0
- if (pose == "Running") then
- RightShoulder.MaxVelocity = 0.1
- LeftShoulder.MaxVelocity = 0.1
- amplitude = 1
- frequency = 9
- elseif (pose == "Climbing") then
- RightShoulder.MaxVelocity = 0.3
- LeftShoulder.MaxVelocity = 0.3
- amplitude = 0
- frequency = 0
- climbFudge = -3.14
- else
- amplitude = 0.1
- frequency = 1
- end
- desiredAngle = amplitude * math.sin(time*frequency)
- RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
- LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
- RightHip:SetDesiredAngle(-desiredAngle)
- LeftHip:SetDesiredAngle(-desiredAngle)
- local tool = getTool()
- if tool then
- animStringValueObject = getToolAnim(tool)
- if animStringValueObject then
- toolAnim = animStringValueObject.Value
- -- message recieved, delete StringValue
- animStringValueObject.Parent = nil
- toolAnimTime = time + .3
- end
- if time > toolAnimTime then
- toolAnimTime = 0
- toolAnim = "None"
- end
- animateTool()
- else
- toolAnim = "None"
- toolAnimTime = 0
- end
- end
- -- connect events
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(onJumping)
- Humanoid.Climbing:connect(onClimbing)
- Humanoid.GettingUp:connect(onGettingUp)
- Humanoid.FreeFalling:connect(onFreeFall)
- Humanoid.FallingDown:connect(onFallingDown)
- Humanoid.Seated:connect(onSeated)
- Humanoid.PlatformStanding:connect(onPlatformStanding)
- Humanoid.Swimming:connect(onSwimming)
- -- main program
- local runService = game:service("RunService");
- while Figure.Parent~=nil do
- local _, time = wait(0.1)
- move(time)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement