Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- local rp = RealPlayer
- script.Parent = rp.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,Functions={},Connect=function(self,f)table.insert(self.Functions,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(),Button2Up=fakeEvent(),Button2Down=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 then
- for _,f in pairs(t.Functions) do
- f(...)
- end
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=rp then return end
- m.Target = io.Target
- m.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return m:TrigEvent(b and "Button2Down" or "Button2Up")
- 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 Mouse = Player:GetMouse()
- 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,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- 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)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local _rg = game
- --Metatable for fake service
- local fsmt = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then
- return typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
- return setmetatable(t,fsmt)
- end
- --Fake game object
- local g = {
- GetService = function(self,s)
- return rawget(self,s) or _rg:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = _rg:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- FakeService(g,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- wait()
- local plr = game.Players.LocalPlayer
- local char = plr.Character
- local m = plr:GetMouse()
- local Run = game:GetService("RunService")
- local Debris = game:GetService("Debris")
- local S = setmetatable({},{__index = function(s,i) return game:service(i) end})
- local CF = {N=CFrame.new,A=CFrame.Angles,fEA=CFrame.fromEulerAnglesXYZ}
- local C3 = {N=Color3.new,RGB=Color3.fromRGB,HSV=Color3.fromHSV,tHSV=Color3.toHSV}
- local V3 = {N=Vector3.new,FNI=Vector3.FromNormalId,A=Vector3.FromAxis}
- local M = {C=math.cos,R=math.rad,S=math.sin,P=math.pi,RNG=math.random,MRS=math.randomseed,H=math.huge,RRNG = function(min,max,div) return math.rad(math.random(min,max)/(div or 1)) end}
- local R3 = {N=Region3.new}
- local De = S.Debris
- local WS = workspace
- local Lght = S.Lighting
- local RepS = S.ReplicatedStorage
- local IN = Instance.new
- local Plrs = S.Players
- local Power = 0
- local Music = Instance.new("Sound", char.Head)
- Music.Looped = true
- local Emit = IN("ParticleEmitter").Emit;
- local Frame_Speed = 60;
- local WalkSpeed = 16
- --// Initializing \\--
- local Plr = game.Players.LocalPlayer
- local Char = Plr.Character
- local m = Plr:GetMouse()
- local Hum = Char:FindFirstChildOfClass'Humanoid'
- local RArm = Char["Right Arm"]
- local LArm = Char["Left Arm"]
- local RLeg = Char["Right Leg"]
- local LLeg = Char["Left Leg"]
- local Root = Char:FindFirstChild'HumanoidRootPart'
- local Torso = Char.Torso
- local Head = Char:WaitForChild("Head")
- local NeutralAnims = true
- local Attack = false
- local Debounces = {Debounces={}}
- local Hit = {}
- local Sine = 0
- Change = 1
- Char.Animate:Destroy()
- --// CHARACTER \\--
- local HeadPhone1 = Instance.new("Part", char)
- HeadPhone1.Size = Vector3.new(0.75, 0.812, 0.375)
- HeadPhone1.CFrame = char.Head.CFrame * CFrame.new(0, 0.344, 0)
- HeadPhone1.Anchored = true
- HeadPhone1.CanCollide = false
- HeadPhone1.BrickColor = BrickColor.new("Lime green")
- HeadPhone1.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = HeadPhone1
- Weld.Part1 = char.Head
- HeadPhone1.Anchored = false
- local HeadPhone2 = Instance.new("WedgePart", char)
- HeadPhone2.Size = Vector3.new(0.375, 0.249, 0.25)
- HeadPhone2.BrickColor = BrickColor.new("Lime green")
- HeadPhone2.CFrame = char.Head.CFrame * CFrame.new(-0.500, 0.625, 0) * CFrame.Angles(0, math.rad(90), 0)
- HeadPhone2.Anchored = true
- HeadPhone2.CanCollide = false
- HeadPhone2.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = HeadPhone2
- Weld.Part1 = char.Head
- HeadPhone2.Anchored = false
- local HeadPhone3 = Instance.new("WedgePart", char)
- HeadPhone3.BrickColor = BrickColor.new("Lime green")
- HeadPhone3.Size = Vector3.new(0.375, 0.249, 0.25)
- HeadPhone3.CFrame = char.Head.CFrame * CFrame.new(0.500, 0.625, 0) * CFrame.Angles(0, math.rad(-90), 0)
- HeadPhone3.Anchored = true
- HeadPhone3.CanCollide = false
- HeadPhone3.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = HeadPhone3
- Weld.Part1 = char.Head
- HeadPhone3.Anchored = false
- local HeadPhone4 = Instance.new("Part", char)
- HeadPhone4.BrickColor = BrickColor.new("Lime green")
- HeadPhone4.Size = Vector3.new(1.25, 0.562, 0.375)
- HeadPhone4.CFrame = char.Head.CFrame * CFrame.new(0, 0.219, 0) * CFrame.Angles(0, 0, 0)
- HeadPhone4.Anchored = true
- HeadPhone4.CanCollide = false
- HeadPhone4.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = HeadPhone4
- Weld.Part1 = char.Head
- HeadPhone4.Anchored = false
- local HeadPhone5 = Instance.new("Part", char)
- HeadPhone5.BrickColor = BrickColor.new("Lime green")
- HeadPhone5.Size = Vector3.new(1.406, 0.75, 0.625)
- HeadPhone5.Shape = "Cylinder"
- HeadPhone5.CFrame = char.Head.CFrame * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
- HeadPhone5.Anchored = true
- HeadPhone5.CanCollide = false
- HeadPhone5.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = HeadPhone5
- Weld.Part1 = char.Head
- HeadPhone5.Anchored = false
- local HeadPhone6 = Instance.new("Part", char)
- HeadPhone6.BrickColor = BrickColor.new("Institutional white")
- HeadPhone6.Size = Vector3.new(1.562, 0.5, 0.417)
- HeadPhone6.Shape = "Cylinder"
- HeadPhone6.CFrame = char.Head.CFrame * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
- HeadPhone6.Anchored = true
- HeadPhone6.CanCollide = false
- HeadPhone6.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = HeadPhone6
- Weld.Part1 = char.Head
- HeadPhone6.Anchored = false
- local RSpeaker1 = Instance.new("Part", char)
- RSpeaker1.BrickColor = BrickColor.new("Smoky grey")
- RSpeaker1.Size = Vector3.new(0.875, 0.875, 0.727)
- RSpeaker1.CFrame = char["Right Arm"].CFrame * CFrame.new(0, 1.438, 0) * CFrame.Angles(0, 0, 0)
- RSpeaker1.Anchored = true
- RSpeaker1.CanCollide = false
- RSpeaker1.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = RSpeaker1
- Weld.Part1 = char["Right Arm"]
- RSpeaker1.Anchored = false
- local RSpeaker2 = Instance.new("Part", char)
- RSpeaker2.BrickColor = BrickColor.new("Smoky grey")
- RSpeaker2.Size = Vector3.new(0.75, 0.875, 0.623)
- RSpeaker2.CFrame = char["Right Arm"].CFrame * CFrame.new(0, 2.188, 0) * CFrame.Angles(0, 0, 0)
- RSpeaker2.Anchored = true
- RSpeaker2.CanCollide = false
- RSpeaker2.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = RSpeaker2
- Weld.Part1 = char["Right Arm"]
- RSpeaker2.Anchored = false
- local RSpeaker3 = Instance.new("Part", char)
- RSpeaker3.BrickColor = BrickColor.new("Lime green")
- RSpeaker3.Shape = "Cylinder"
- RSpeaker3.Size = Vector3.new(0.062, 0.716, 0.716)
- RSpeaker3.CFrame = char["Right Arm"].CFrame * CFrame.new(0, 1.438, -0.410) * CFrame.Angles(0, math.rad(90), 0)
- RSpeaker3.Anchored = true
- RSpeaker3.CanCollide = false
- RSpeaker3.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = RSpeaker3
- Weld.Part1 = char["Right Arm"]
- RSpeaker3.Anchored = false
- local RSpeaker4 = Instance.new("Part", char)
- RSpeaker4.BrickColor = BrickColor.new("Institutional white")
- RSpeaker4.Shape = "Cylinder"
- RSpeaker4.Size = Vector3.new(0.08, 0.716, 0.341)
- RSpeaker4.CFrame = char["Right Arm"].CFrame * CFrame.new(0, 1.438, -0.418) * CFrame.Angles(0, math.rad(90), 0)
- RSpeaker4.Anchored = true
- RSpeaker4.CanCollide = false
- RSpeaker4.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = RSpeaker4
- Weld.Part1 = char["Right Arm"]
- RSpeaker4.Anchored = false
- local RSpeaker5 = Instance.new("Part", char)
- RSpeaker5.BrickColor = BrickColor.new("Lime green")
- RSpeaker5.Shape = "Cylinder"
- RSpeaker5.Size = Vector3.new(0.062, 0.614, 0.489)
- RSpeaker5.CFrame = char["Right Arm"].CFrame * CFrame.new(0, 2.25, -0.363) * CFrame.Angles(0, math.rad(90), 0)
- RSpeaker5.Anchored = true
- RSpeaker5.CanCollide = false
- RSpeaker5.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = RSpeaker5
- Weld.Part1 = char["Right Arm"]
- RSpeaker5.Anchored = false
- local RSpeaker6 = Instance.new("Part", char)
- RSpeaker6.BrickColor = BrickColor.new("Institutional white")
- RSpeaker6.Shape = "Cylinder"
- RSpeaker6.Size = Vector3.new(0.068, 0.614, 0.239)
- RSpeaker6.CFrame = char["Right Arm"].CFrame * CFrame.new(0, 2.25, -0.366) * CFrame.Angles(0, math.rad(90), 0)
- RSpeaker6.Anchored = true
- RSpeaker6.CanCollide = false
- RSpeaker6.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = RSpeaker6
- Weld.Part1 = char["Right Arm"]
- RSpeaker6.Anchored = false
- local LSpeaker1 = Instance.new("Part", char)
- LSpeaker1.BrickColor = BrickColor.new("Smoky grey")
- LSpeaker1.Size = Vector3.new(0.875, 0.875, 0.727)
- LSpeaker1.CFrame = char["Left Arm"].CFrame * CFrame.new(0, 1.438, 0) * CFrame.Angles(0, 0, 0)
- LSpeaker1.Anchored = true
- LSpeaker1.CanCollide = false
- LSpeaker1.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = LSpeaker1
- Weld.Part1 = char["Left Arm"]
- LSpeaker1.Anchored = false
- local LSpeaker2 = Instance.new("Part", char)
- LSpeaker2.BrickColor = BrickColor.new("Smoky grey")
- LSpeaker2.Size = Vector3.new(0.75, 0.875, 0.623)
- LSpeaker2.CFrame = char["Left Arm"].CFrame * CFrame.new(0, 2.188, 0) * CFrame.Angles(0, 0, 0)
- LSpeaker2.Anchored = true
- LSpeaker2.CanCollide = false
- LSpeaker2.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = LSpeaker2
- Weld.Part1 = char["Left Arm"]
- LSpeaker2.Anchored = false
- local LSpeaker3 = Instance.new("Part", char)
- LSpeaker3.BrickColor = BrickColor.new("Lime green")
- LSpeaker3.Shape = "Cylinder"
- LSpeaker3.Size = Vector3.new(0.062, 0.716, 0.716)
- LSpeaker3.CFrame = char["Left Arm"].CFrame * CFrame.new(0, 1.438, -0.410) * CFrame.Angles(0, math.rad(90), 0)
- LSpeaker3.Anchored = true
- LSpeaker3.CanCollide = false
- LSpeaker3.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = LSpeaker3
- Weld.Part1 = char["Left Arm"]
- LSpeaker3.Anchored = false
- local LSpeaker4 = Instance.new("Part", char)
- LSpeaker4.BrickColor = BrickColor.new("Institutional white")
- LSpeaker4.Shape = "Cylinder"
- LSpeaker4.Size = Vector3.new(0.08, 0.716, 0.341)
- LSpeaker4.CFrame = char["Left Arm"].CFrame * CFrame.new(0, 1.438, -0.418) * CFrame.Angles(0, math.rad(90), 0)
- LSpeaker4.Anchored = true
- LSpeaker4.CanCollide = false
- LSpeaker4.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = LSpeaker4
- Weld.Part1 = char["Left Arm"]
- LSpeaker4.Anchored = false
- local LSpeaker5 = Instance.new("Part", char)
- LSpeaker5.BrickColor = BrickColor.new("Lime green")
- LSpeaker5.Shape = "Cylinder"
- LSpeaker5.Size = Vector3.new(0.062, 0.614, 0.489)
- LSpeaker5.CFrame = char["Left Arm"].CFrame * CFrame.new(0, 2.25, -0.363) * CFrame.Angles(0, math.rad(90), 0)
- LSpeaker5.Anchored = true
- LSpeaker5.CanCollide = false
- LSpeaker5.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = LSpeaker5
- Weld.Part1 = char["Left Arm"]
- LSpeaker5.Anchored = false
- local LSpeaker6 = Instance.new("Part", char)
- LSpeaker6.BrickColor = BrickColor.new("Institutional white")
- LSpeaker6.Shape = "Cylinder"
- LSpeaker6.Size = Vector3.new(0.068, 0.614, 0.239)
- LSpeaker6.CFrame = char["Left Arm"].CFrame * CFrame.new(0, 2.25, -0.366) * CFrame.Angles(0, math.rad(90), 0)
- LSpeaker6.Anchored = true
- LSpeaker6.CanCollide = false
- LSpeaker6.Material = "SmoothPlastic"
- local Weld = Instance.new("WeldConstraint", char)
- Weld.Part0 = LSpeaker6
- Weld.Part1 = char["Left Arm"]
- LSpeaker6.Anchored = false
- plr.Chatted:Connect(function(msg)
- if string.sub(msg,1,3) == "id;" then
- Music.SoundId = "rbxassetid://"..string.sub(msg,4)
- Music:Play()
- end
- end)
- plr.Chatted:Connect(function(msg)
- if string.sub(msg,1,7) == "volume;" then
- Music.Volume = string.sub(msg,8)
- end
- end)
- m.KeyDown:Connect(function(k)
- k:lower()
- if k == "f" then
- local SoundEX = Instance.new("Part", workspace)
- SoundEX.Shape = "Ball"
- SoundEX.Anchored = false
- SoundEX.BrickColor = BrickColor.new("Lime green")
- SoundEX.CFrame = RSpeaker1.CFrame
- SoundEX.Transparency = 0
- local SoundEX2 = Instance.new("Part", workspace)
- SoundEX2.Shape = "Ball"
- SoundEX2.Anchored = false
- SoundEX2.CanCollide = false
- SoundEX.CanCollide = false
- SoundEX2.BrickColor = BrickColor.new("Lime green")
- SoundEX2.CFrame = LSpeaker1.CFrame
- SoundEX2.Material = Enum.Material.ForceField
- SoundEX.Material = Enum.Material.ForceField
- SoundEX2.Transparency = 0
- Debris:AddItem(SoundEX, 0.5)
- Debris:AddItem(SoundEX2, 0.5)
- SoundEX.Size = Vector3.new(1, 1, 1)
- SoundEX2.Size = Vector3.new(1, 1, 1)
- wait()
- SoundEX.Velocity = Vector3.new(0, 0, 0)
- SoundEX2.Velocity = Vector3.new(0, 0, 0)
- SoundEX2.Transparency = 0.1
- SoundEX.Transparency = 0.1
- SoundEX.Size = SoundEX.Size * 1.35
- SoundEX2.Size = SoundEX2.Size * 1.35
- wait()
- SoundEX.Velocity = Vector3.new(0, 0, 0)
- SoundEX2.Velocity = Vector3.new(0, 0, 0)
- SoundEX.Size = SoundEX.Size * 1.35
- SoundEX2.Size = SoundEX2.Size * 1.35
- SoundEX2.Transparency = 0.2
- SoundEX.Transparency = 0.2
- wait()
- SoundEX.Velocity = Vector3.new(0, 0, 0)
- SoundEX2.Velocity = Vector3.new(0, 0, 0)
- SoundEX.Size = SoundEX.Size * 1.35
- SoundEX2.Size = SoundEX2.Size * 1.35
- SoundEX2.Transparency = 0.3
- SoundEX.Transparency = 0.3
- wait()
- SoundEX.Velocity = Vector3.new(0, 0, 0)
- SoundEX2.Velocity = Vector3.new(0, 0, 0)
- SoundEX.Size = SoundEX.Size * 1.35
- SoundEX2.Size = SoundEX2.Size * 1.35
- SoundEX2.Transparency = 0.4
- SoundEX.Transparency = 0.4
- wait()
- SoundEX.Velocity = Vector3.new(0, 0, 0)
- SoundEX2.Velocity = Vector3.new(0, 0, 0)
- SoundEX.Size = SoundEX.Size * 1.35
- SoundEX2.Size = SoundEX2.Size * 1.35
- SoundEX2.Transparency = 0.5
- SoundEX.Transparency = 0.5
- wait()
- SoundEX.Velocity = Vector3.new(0, 0, 0)
- SoundEX2.Velocity = Vector3.new(0, 0, 0)
- SoundEX.Size = SoundEX.Size * 1.35
- SoundEX2.Size = SoundEX2.Size * 1.35
- SoundEX2.Transparency = 0.6
- SoundEX.Transparency = 0.6
- wait()
- SoundEX.Velocity = Vector3.new(0, 0, 0)
- SoundEX2.Velocity = Vector3.new(0, 0, 0)
- SoundEX.Size = SoundEX.Size * 1.35
- SoundEX2.Size = SoundEX2.Size * 1.35
- SoundEX2.Transparency = 0.7
- SoundEX.Transparency = 0.7
- wait()
- SoundEX.Velocity = Vector3.new(0, 0, 0)
- SoundEX2.Velocity = Vector3.new(0, 0, 0)
- SoundEX.Size = SoundEX.Size * 1.35
- SoundEX2.Size = SoundEX2.Size * 1.35
- SoundEX2.Transparency = 0.8
- SoundEX.Transparency = 0.8
- wait()
- SoundEX.Velocity = Vector3.new(0, 0, 0)
- SoundEX2.Velocity = Vector3.new(0, 0, 0)
- SoundEX.Size = SoundEX.Size * 1.35
- SoundEX2.Size = SoundEX2.Size * 1.35
- SoundEX2.Transparency = 0.9
- SoundEX.Transparency = 0.9
- wait()
- SoundEX.Velocity = Vector3.new(0, 0, 0)
- SoundEX2.Velocity = Vector3.new(0, 0, 0)
- SoundEX.Size = SoundEX.Size * 1.35
- SoundEX2.Size = SoundEX2.Size * 1.35
- SoundEX2.Transparency = 1
- SoundEX.Transparency = 1
- dam = false
- SoundEX.Touched:Connect(function(s)
- if s.Parent:FindFirstChildOfClass("Humanoid") and s.Parent.Name ~= char.Name then
- if dam == false then
- local hit = Instance.new("Sound", s)
- hit.SoundId = "rbxassetid://406913243"
- hit:Play()
- s.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(10)
- dam = true
- end
- end
- end)
- SoundEX2.Touched:Connect(function(s)
- if s.Parent:FindFirstChildOfClass("Humanoid") and s.Parent.Name ~= char.Name then
- if dam == false then
- local hit = Instance.new("Sound", s)
- hit.SoundId = "rbxassetid://406913243"
- hit:Play()
- s.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(10)
- dam = true
- end
- end
- end)
- end
- end)
- --// Instance Creation Functions \\--
- function Part(parent,color,material,size,cframe,anchored,cancollide)
- local part = IN("Part")
- part.Parent = parent or Char
- part[typeof(color) == 'BrickColor' and 'BrickColor' or 'Color'] = color or C3.N(0,0,0)
- part.Material = material or Enum.Material.SmoothPlastic
- part.TopSurface,part.BottomSurface=10,10
- part.Size = size or V3.N(1,1,1)
- part.CFrame = cframe or CF.N(0,0,0)
- part.CanCollide = cancollide or false
- part.Anchored = anchored or false
- return part
- end
- function Weld(part0,part1,c0,c1)
- local weld = IN("Weld")
- weld.Parent = part0
- weld.Part0 = part0
- weld.Part1 = part1
- weld.C0 = c0 or CF.N()
- weld.C1 = c1 or CF.N()
- return weld
- end
- function Mesh(parent,meshtype,meshid,textid,scale,offset)
- local part = IN("SpecialMesh")
- part.MeshId = meshid or ""
- part.TextureId = textid or ""
- part.Scale = scale or V3.N(1,1,1)
- part.Offset = offset or V3.N(0,0,0)
- part.MeshType = meshtype or Enum.MeshType.Sphere
- part.Parent = parent
- return part
- end
- NewInstance = function(instance,parent,properties)
- local inst = Instance.new(instance)
- inst.Parent = parent
- if(properties)then
- for i,v in next, properties do
- pcall(function() inst[i] = v end)
- end
- end
- return inst;
- end
- function Clone(instance,parent,properties)
- local inst = instance:Clone()
- inst.Parent = parent
- if(properties)then
- for i,v in next, properties do
- pcall(function() inst[i] = v end)
- end
- end
- return inst;
- end
- --// Customization \\--
- local DamageColor = BrickColor.new'White'
- --// Stop animations \\--
- for _,v in next, Hum:GetPlayingAnimationTracks() do
- v:Stop();
- end
- pcall(game.Destroy,Char:FindFirstChild'Animate')
- pcall(game.Destroy,Hum:FindFirstChild'Animator')
- --// Joints \\--
- local LS = NewInstance('Motor',Char,{Part0=Torso,Part1=LArm,C0 = CF.N(-1.5,0.5,0),C1 = CF.N(0,.5,0)})
- local RS = NewInstance('Motor',Char,{Part0=Torso,Part1=RArm,C0 = CF.N(1.5,0.5,0),C1 = CF.N(0,.5,0)})
- local NK = NewInstance('Motor',Char,{Part0=Torso,Part1=Head,C0 = CF.N(0,1.5,0)})
- local LH = NewInstance('Motor',Char,{Part0=Torso,Part1=LLeg,C0 = CF.N(-.5,-1,0),C1 = CF.N(0,1,0)})
- local RH = NewInstance('Motor',Char,{Part0=Torso,Part1=RLeg,C0 = CF.N(.5,-1,0),C1 = CF.N(0,1,0)})
- local RJ = NewInstance('Motor',Char,{Part0=Root,Part1=Torso})
- local LSC0 = LS.C0
- local RSC0 = RS.C0
- local NKC0 = NK.C0
- local LHC0 = LH.C0
- local RHC0 = RH.C0
- local RJC0 = RJ.C0
- --// Artificial HB \\--
- local ArtificialHB = IN("BindableEvent", script)
- ArtificialHB.Name = "Heartbeat"
- script:WaitForChild("Heartbeat")
- local tf = 0
- local allowframeloss = false
- local tossremainder = false
- local lastframe = tick()
- local frame = 1/Frame_Speed
- ArtificialHB:Fire()
- game:GetService("RunService").Heartbeat:connect(function(s, p)
- tf = tf + s
- if tf >= frame then
- if allowframeloss then
- script.Heartbeat:Fire()
- lastframe = tick()
- else
- for i = 1, math.floor(tf / frame) do
- ArtificialHB:Fire()
- end
- lastframe = tick()
- end
- if tossremainder then
- tf = 0
- else
- tf = tf - frame * math.floor(tf / frame)
- end
- end
- end)
- function swait(num)
- if num == 0 or num == nil then
- ArtificialHB.Event:wait()
- else
- for i = 0, num do
- ArtificialHB.Event:wait()
- end
- end
- end
- mesuk = "Put id of the music here"
- while true do
- swait()
- Sine = Sine + Change
- local hitfloor,posfloor = workspace:FindPartOnRay(Ray.new(Root.CFrame.p,((CFrame.new(Root.Position,Root.Position - Vector3.new(0,1,0))).lookVector).unit * (4)), Char)
- local Walking = (math.abs(Root.Velocity.x) > 1 or math.abs(Root.Velocity.z) > 1)
- local State = (Hum.PlatformStand and 'Paralyzed' or Hum.Sit and 'Sit' or not hitfloor and Root.Velocity.y < -1 and "Fall" or not hitfloor and Root.Velocity.y > 1 and "Jump" or hitfloor and Walking and (Hum.WalkSpeed > 24 and "Run" or "Walk") or hitfloor and "Idle")
- if(not Effects or not Effects.Parent)then
- Effects = IN("Model",Char)
- Effects.Name = "Effects"
- end
- if(State == 'Walk')then
- local wsVal = 20 / (Hum.WalkSpeed/16)
- local Alpha = math.min(.3 * (Hum.WalkSpeed/8),1)
- Change = 3
- RH.C1 = RH.C1:lerp(CF.N(0,1,0)*CF.N(0,0-.5*M.C(Sine/wsVal)/2,0+.6*M.C(Sine/wsVal)/2)*CF.A(M.R(15-2*M.C(Sine/wsVal))+-M.S(Sine/wsVal)/2.5,0,0),Alpha)
- LH.C1 = LH.C1:lerp(CF.N(0,1,0)*CF.N(0,0+.5*M.C(Sine/wsVal)/2,0-.6*M.C(Sine/wsVal)/2)*CF.A(M.R(15+2*M.C(Sine/wsVal))+M.S(Sine/wsVal)/2.5,0,0),Alpha)
- else
- RH.C1 = RH.C1:lerp(CF.N(0,1,0),.2)
- LH.C1 = LH.C1:lerp(CF.N(0,1,0),.2)
- end
- Hum.WalkSpeed = WalkSpeed
- if(NeutralAnims)then
- if(State == 'Idle')then
- local Alpha = .1
- Change = .75
- RJ.C0 = RJ.C0:lerp(RJC0*CF.N(0*M.C(Sine/12),.2*M.C(Sine/6),0)*CF.A(M.R(0*M.C(Sine/12)),0,0),Alpha)
- NK.C0 = NK.C0:lerp(NKC0*CF.A(M.R(0*M.C(Sine/12)),0,0),Alpha)
- LS.C0 = LS.C0:lerp(LSC0*CF.N(0,0,0)*CF.A(M.R(0.01),0,M.R(-10*M.C(Sine/12))),Alpha)
- RS.C0 = RS.C0:lerp(RSC0*CF.N(0,0,0)*CF.A(M.R(0.01),0,M.R(10*M.C(Sine/12))),Alpha)
- LH.C0 = LH.C0:lerp(LHC0*CF.N(0*M.C(Sine/12),0*M.C(Sine/6),0)*CF.A(M.R(0*M.C(Sine/12)),M.R(7),0),Alpha)
- RH.C0 = RH.C0:lerp(RHC0*CF.N(0*M.C(Sine/12),0*M.C(Sine/6),0)*CF.A(M.R(0*M.C(Sine/12)),M.R(-7),0),Alpha)
- -- idle
- elseif(State == 'Run')then
- local wsVal = 20 / (Hum.WalkSpeed/16)
- local Alpha = math.min(.2 * (Hum.WalkSpeed/16),1)
- RJ.C0 = RJ.C0:lerp(CF.N(0,0-.1*M.C(Sine/(wsVal/2)),0)*CF.A(M.R(-15+2.5*M.C(Sine/(wsVal/2))),M.R(8*M.C(Sine/wsVal)),0),Alpha)
- NK.C0 = NK.C0:lerp(NKC0,Alpha)
- LS.C0 = LS.C0:lerp(LSC0*CF.N(0,0,0-.3*M.S(Sine/wsVal))*CF.A(M.R(0+45*M.S(Sine/wsVal)),0,M.R(-5)),Alpha)
- RS.C0 = RS.C0:lerp(RSC0*CF.N(0,0,0+.3*M.S(Sine/wsVal))*CF.A(M.R(0-45*M.S(Sine/wsVal)),0,M.R(5)),Alpha)
- LH.C0 = LH.C0:lerp(LHC0*CF.N(0,0+.1*M.C(Sine/(wsVal/2)),0)*CF.A(0,-M.R(4*M.C(Sine/wsVal)),0),Alpha)
- RH.C0 = RH.C0:lerp(RHC0*CF.N(0,0+.1*M.C(Sine/(wsVal/2)),0)*CF.A(0,-M.R(4*M.C(Sine/wsVal)),0),Alpha)
- elseif(State == 'Walk')then
- local wsVal = 20 / (Hum.WalkSpeed/16)
- local Alpha = math.min(.3 * (Hum.WalkSpeed/16),1)
- RJ.C0 = RJ.C0:lerp(CF.N(0,0-.1*M.C(Sine/(wsVal/2)),0)*CF.A(M.R(-5-2.5*M.C(Sine/(wsVal/2))),M.R(0*M.C(Sine/wsVal)),0),Alpha)
- NK.C0 = NK.C0:lerp(NKC0,Alpha)
- LS.C0 = LS.C0:lerp(LSC0*CF.N(0,0,-.22*M.C(Sine/wsVal))*CF.A(M.R(37*M.C(Sine/wsVal)),0,M.R(-5)),Alpha)
- RS.C0 = RS.C0:lerp(RSC0*CF.N(0,0,.22*M.C(Sine/wsVal))*CF.A(M.R(-37*M.C(Sine/wsVal)),0,M.R(5)),Alpha)
- LH.C0 = LH.C0:lerp(LHC0*CF.N(0,0+.1*M.C(Sine/(wsVal/2)),0)*CF.A(0,-M.R(4*M.C(Sine/wsVal)),0),Alpha)
- RH.C0 = RH.C0:lerp(RHC0*CF.N(0,0+.1*M.C(Sine/(wsVal/2)),0)*CF.A(0,-M.R(4*M.C(Sine/wsVal)),0),Alpha)
- elseif(State == 'Jump')then
- local Alpha = .1
- local idk = math.min(math.max(Root.Velocity.Y/50,-M.R(90)),M.R(90))
- LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(-5),0,M.R(5)),Alpha)
- RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(-5),0,M.R(-5)),Alpha)
- RJ.C0 = RJ.C0:lerp(RJC0*CF.A(math.min(math.max(Root.Velocity.Y/100,-M.R(45)),M.R(45)),0,0),Alpha)
- NK.C0 = NK.C0:lerp(NKC0*CF.A(math.min(math.max(Root.Velocity.Y/100,-M.R(45)),M.R(45)),0,0),Alpha)
- LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha)
- RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha)
- elseif(State == 'Fall')then
- local Alpha = .1
- local idk = math.min(math.max(Root.Velocity.Y/50,-M.R(90)),M.R(90))
- LS.C0 = LS.C0:lerp(LSC0*CF.A(M.R(-5),0,M.R(-5)+idk),Alpha)
- RS.C0 = RS.C0:lerp(RSC0*CF.A(M.R(-5),0,M.R(5)-idk),Alpha)
- RJ.C0 = RJ.C0:lerp(RJC0*CF.A(math.min(math.max(Root.Velocity.Y/100,-M.R(45)),M.R(45)),0,0),Alpha)
- NK.C0 = NK.C0:lerp(NKC0*CF.A(math.min(math.max(Root.Velocity.Y/100,-M.R(45)),M.R(45)),0,0),Alpha)
- LH.C0 = LH.C0:lerp(LHC0*CF.A(0,0,M.R(-5)),Alpha)
- RH.C0 = RH.C0:lerp(RHC0*CF.N(0,1,-1)*CF.A(M.R(-5),0,M.R(5)),Alpha)
- elseif(State == 'Paralyzed')then
- -- paralyzed
- elseif(State == 'Sit')then
- -- sit
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement