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
- print("FE Compatibility code by Mokiros")
- 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()}
- 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
- 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 s[k] end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end,
- __call = function(self,...)
- local s = rawget(self,"_RealService")
- if s then return s(...) 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 self[s]
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- g.RunService = FakeService({
- 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")
- setmetatable(g,{
- __index=function(self,s)
- return _rg:GetService(s) or typeof(_rg[s])=="function"
- and function(_,...)return _rg[s](_rg,...)end or _rg[s]
- end,
- __newindex = fsmt.__newindex,
- __call = fsmt.__call
- })
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- -- NOTE (READ!!): This script doesn't work on voidacity's script builder
- -- since it crashes your game, but it's usable on other
- -- script builders like fancy dev's or nexure's.
- -- (it just doesn't work on voidacity only)
- --[[
- --Made by Zalgo_exe/EXE/Zalgo--
- wait(0.2)
- local Player, Character, Mouse = game:service("Players").LocalPlayer, game:GetService("Players").LocalPlayer.Character, game:GetService("Players").LocalPlayer:GetMouse();
- local Torso = Character:FindFirstChild("Torso")
- local rootPart = Character:FindFirstChild("HumanoidRootPart")
- local Humanoid = Character:FindFirstChild("Humanoid")
- local Head = Character:FindFirstChild("Head")
- local Right_Arm = Character:FindFirstChild("Right Arm")
- local Left_Arm = Character:FindFirstChild("Left Arm")
- local Right_Leg = Character:FindFirstChild("Right Leg")
- local Left_Leg = Character:FindFirstChild("Left Leg")
- local Right_Shoulder = Torso:FindFirstChild("Right Shoulder")
- local Left_Shoulder = Torso:FindFirstChild("Left Shoulder")
- local Right_Hip = Torso:FindFirstChild("Right Hip")
- local Left_Hip = Torso:FindFirstChild("Left Hip")
- local Neck = Torso:FindFirstChild("Neck")
- local rootPart = Character:FindFirstChild("HumanoidRootPart")
- local rootJoint = rootPart:FindFirstChild("RootJoint")
- local CurrentIdle = "Idling1"
- local Degree = 0.0175438596491228
- local canremove = false
- local debounce = false
- local UIService=game:GetService'UserInputService'
- _G.SongName = math.random(1,9025232)
- sin = math.sin
- Right_Leg.FormFactor = "Custom";
- Left_Leg.FormFactor = "Custom";
- rootPart.Archivable = true;
- rootJoint.Archivable = true;
- c_new = CFrame.new;
- c_angles = CFrame.Angles;
- i_new = Instance.new
- Humanoid:ClearAllChildren();
- local isAttacking = false
- local isSprinting = false
- local Animations = false
- local Angle = 0
- local Axis = 0
- local angleSpeed = 1
- local axisSpeed = angleSpeed
- local currentAnim
- local levetatingheight = 3
- local WalkType = "Ground"
- function Sound(parent,loop,vol,id)
- local s = Instance.new('Sound',parent)
- s.Looped = loop
- s.Volume = vol
- s.MaxDistance=200
- s.EmitterSize=20
- s.SoundId = 'rbxassetid://'..tostring(id)
- s:Play()
- if loop == false then
- wait(s.TimeLength)
- s:Destroy()
- end
- end
- Sound(rootPart,true,10,1549917765)
- newWeld = function(wp0, wp1, wc0x, wc0y, wc0z)
- wld = Instance.new("Weld", wp1)
- wld.Part0 = wp0
- wld.Part1 = wp1
- wld.C0 = CFrame.new(wc0x, wc0y, wc0z)
- return wld
- end
- function noOutline(part)
- part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
- end
- local function Part(Name,Color, Material, Transparency,Shape, Size, CFrame,CanCollide,Anchored,parent)
- local partie = i_new("Part",parent)
- partie.Name=Name
- partie.BrickColor = BrickColor.new(Color)
- partie.Material = Material
- partie.Shape = Shape
- partie.Transparency = Transparency
- partie.Size = Size
- partie.CFrame = CFrame
- partie.CanCollide = CanCollide
- partie.Anchored = Anchored
- return partie
- end
- function swait(num)
- if num == 0 or num == nil then
- game:GetService("RunService").Stepped:wait(0)
- else
- for i = 0, num do
- game:GetService("RunService").Stepped:wait(0)
- end
- end
- end
- function mesh(Mesh, part, meshtype, meshid, offset, scale)
- local mesh = i_new(Mesh)
- mesh.Parent = part
- if Mesh == "SpecialMesh" then
- mesh.MeshType = meshtype
- mesh.MeshId = meshid
- end
- mesh.Offset = offset
- mesh.Scale = scale
- return mesh
- end
- mouse = Player:GetMouse()
- function findCloseHumanoid(centre, distance)
- local tab = {}
- for _, child in pairs(game.Workspace:GetChildren()) do
- if child:findFirstChild("Humanoid") and child:findFirstChild("Humanoid") ~= Humanoid and child:findFirstChild("Torso") then
- local vtors = child.Torso
- local mag = math.abs((vtors.Position - centre).magnitude)
- if distance >= mag then
- table.insert(tab, child.Humanoid)
- end
- end
- end
- return tab
- end
- function rayCast(Pos, Dir, Max, Ignore) -- Origin Position, Direction, MaxDistance, IgnoreDescendants
- return game:GetService("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
- 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 m11 > m00 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 >= 0.0001 then
- if (1 - cosTheta) > 0.0001 then
- local theta = math.acos(cosTheta)
- local invSinTheta = 1/math.sin(theta)
- startInterp = math.sin((1-t)*theta)*invSinTheta
- finishInterp = math.sin(t*theta)*invSinTheta
- else
- startInterp = 1-t
- finishInterp = t
- end
- else
- if (1+cosTheta) > 0.0001 then
- local theta = math.acos(-cosTheta)
- local invSinTheta = 1/math.sin(theta)
- startInterp = math.sin((t-1)*theta)*invSinTheta
- finishInterp = math.sin(t*theta)*invSinTheta
- else
- startInterp = t-1
- finishInterp = t
- end
- 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 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
- swait()
- LA_Weld = newWeld(Torso, Left_Arm, -1.5, 0.5, 0)
- Left_Arm.Weld.C1 = CFrame.new(0, 0.5, 0)
- RA_Weld = newWeld(Torso, Right_Arm, 1.5, 0.5, 0)
- Right_Arm.Weld.C1 = CFrame.new(0, 0.5, 0)
- LL_Weld = newWeld(Torso, Left_Leg, -0.5, -1, 0)
- Left_Leg.Weld.C1 = CFrame.new(0, 1, 0) -- Left_Leg.Weld.C1 = CFrame.new(0, 1, 0.15)
- RL_Weld = newWeld(Torso, Right_Leg, 0.5, -1, 0)
- Right_Leg.Weld.C1 = CFrame.new(0, 1, 0) -- Right_Leg.Weld.C1 = CFrame.new(0, 1, 0.15)
- Torso_Weld = newWeld(rootPart, Torso, 0, -1, 0)
- Torso.Weld.C1 = CFrame.new(0, -1, 0)
- Head_Weld = newWeld(Torso, Head, 0, 1.5, 0)
- for i,v in pairs(Character:GetChildren()) do
- if v:IsA('Accoutrement') or v:IsA('Shirt') or v:IsA('Pants') or v:IsA("CharacterMesh") then
- v:Destroy()
- elseif v:IsA('Part') and v.Name=='Head' then
- v.face.Texture = "rbxassetid://426704543"
- end
- end
- Shirt = Instance.new("Part",Character)
- Shirt.CanCollide = false
- Shirt.BrickColor = BrickColor.new("Persimmon")
- Shirt.Material = "SmoothPlastic"
- Shirt.Size = Vector3.new(2.1,2.02,1.03)
- Shirt.TopSurface = Enum.SurfaceType.Smooth
- Shirt.BottomSurface = Enum.SurfaceType.Smooth
- local ShirtWeld = Instance.new("Weld", Shirt)
- ShirtWeld.Part0 = Torso
- ShirtWeld.Part1 = Shirt
- ShirtWeld.C1 = CFrame.new(0,0,0)
- Star = Instance.new("Part",Character)
- Star.CanCollide = false
- Star.Transparency = 1
- Star.Size = Vector3.new(2.1,2.1,0)
- Star.TopSurface = Enum.SurfaceType.Smooth
- Star.BottomSurface = Enum.SurfaceType.Smooth
- local StarWeld = Instance.new("Weld", Star)
- StarWeld.Part0 = Torso
- StarWeld.Part1 = Star
- StarWeld.C1 = CFrame.new(0,-0.15,0.53)
- Decal = Instance.new("Decal",Star)
- Decal.Texture = "rbxassetid://426707982"
- Decal.Face = "Front"
- BackShirt = Instance.new("Part",Character)
- BackShirt.CanCollide = false
- BackShirt.BrickColor = BrickColor.new("Persimmon")
- BackShirt.Size = Vector3.new(2.1,1.1,0.5)
- BackShirt.TopSurface = Enum.SurfaceType.Smooth
- BackShirt.BottomSurface = Enum.SurfaceType.Smooth
- BackShirt.Transparency = 1
- BackShirt.Material = "SmoothPlastic"
- local BackShirtWeld = Instance.new("Weld", BackShirt)
- BackShirtWeld.Part0 = Torso
- BackShirtWeld.Part1 = BackShirt
- BackShirtWeld.C1 = CFrame.new(0,0.1,-0.265)
- RolledUpShirt = Instance.new("Part",Character)
- RolledUpShirt.CanCollide = false
- RolledUpShirt.BrickColor = BrickColor.new("Salmon")
- RolledUpShirt.Size = Vector3.new(2.15,0.2,1)
- RolledUpShirt.TopSurface = Enum.SurfaceType.Smooth
- RolledUpShirt.BottomSurface = Enum.SurfaceType.Smooth
- RolledUpShirt.Transparency = 1
- RolledUpShirt.Material = "SmoothPlastic"
- local RolledUpShirtWeld = Instance.new("Weld", RolledUpShirt)
- RolledUpShirtWeld.Part0 = Torso
- RolledUpShirtWeld.Part1 = RolledUpShirt
- RolledUpShirtWeld.C1 = CFrame.new(0,0.4,-0.03)*CFrame.fromEulerAnglesXYZ(math.rad(-30),math.rad(0),math.rad(0))
- Shirt2 = Instance.new("Part",Character)
- Shirt2.CanCollide = false
- Shirt2.BrickColor = BrickColor.new("Persimmon")
- Shirt2.Size = Vector3.new(2.1,0.5,0.8)
- Shirt2.TopSurface = Enum.SurfaceType.Smooth
- Shirt2.BottomSurface = Enum.SurfaceType.Smooth
- Shirt2.Transparency = 1
- Shirt2.Material = "SmoothPlastic"
- local Shirt2Weld = Instance.new("Weld", Shirt2)
- Shirt2Weld.Part0 = Torso
- Shirt2Weld.Part1 = Shirt2
- Shirt2Weld.C1 = CFrame.new(0,0.2,-0.05)*CFrame.fromEulerAnglesXYZ(math.rad(-30),math.rad(0),math.rad(0))
- Sleeve1 = Instance.new("Part",Character)
- Sleeve1.CanCollide = false
- Sleeve1.BrickColor = BrickColor.new("Persimmon")
- Sleeve1.Size = Vector3.new(1.02,0.5,1.02)
- Sleeve1.TopSurface = Enum.SurfaceType.Smooth
- Sleeve1.BottomSurface = Enum.SurfaceType.Smooth
- Sleeve1.Material = "SmoothPlastic"
- local Sleeve1Weld = Instance.new("Weld", Sleeve1)
- Sleeve1Weld.Part0 = Right_Arm
- Sleeve1Weld.Part1 = Sleeve1
- Sleeve1Weld.C1 = CFrame.new(0,-0.76,0)
- Sleeve2 = Instance.new("Part",Character)
- Sleeve2.CanCollide = false
- Sleeve2.BrickColor = BrickColor.new("Persimmon")
- Sleeve2.Size = Vector3.new(1.02,0.5,1.02)
- Sleeve2.TopSurface = Enum.SurfaceType.Smooth
- Sleeve2.BottomSurface = Enum.SurfaceType.Smooth
- Sleeve2.Material = "SmoothPlastic"
- local Sleeve2Weld = Instance.new("Weld", Sleeve2)
- Sleeve2Weld.Part0 = Left_Arm
- Sleeve2Weld.Part1 = Sleeve2
- Sleeve2Weld.C1 = CFrame.new(0,-0.76,0)
- local Hair = Instance.new("Part",Head)
- Hair.Name = "Hair"
- Hair.Shape = Enum.PartType.Ball
- Hair.CanCollide = false
- Hair.BrickColor = BrickColor.new("Really black")
- Hair.Transparency = 0
- Hair.Material = "Grass"
- Hair.Size = Vector3.new(0.1, 0.1, 0.1)
- Hair.TopSurface = Enum.SurfaceType.Smooth
- Hair.BottomSurface = Enum.SurfaceType.Smooth local Weld = Instance.new("Weld", Hair)
- Weld.Part0 = Head
- Weld.Part1 = Hair
- Weld.C1 = CFrame.new(0,-0.5,0)
- HairMesh = Instance.new("FileMesh",Hair)
- HairMesh.MeshId = "http://www.roblox.com/asset/?id=31309506"
- HairMesh.TextureId = "rbxassetid://36482234"
- HairMesh.Scale = Vector3.new(1.03,1.05,1.03)
- local Shield = Instance.new("Part",Torso)
- Shield.Name = "Shield"
- Shield.Shape = Enum.PartType.Ball
- Shield.BrickColor = BrickColor.new("Really black")
- Shield.Transparency = 1
- Shield.CanCollide = false
- Shield.Material = "Grass"
- Shield.Size = Vector3.new(5, 5, 5)
- Shield.TopSurface = Enum.SurfaceType.Smooth
- Shield.BottomSurface = Enum.SurfaceType.Smooth local ShieldWeld = Instance.new("Weld", Shield)
- ShieldWeld.Part0 = Torso
- ShieldWeld.Part1 = Shield
- ShieldWeld.C1 = CFrame.new(0,-0.5,0)
- ShieldMesh = Instance.new("FileMesh",Shield)
- ShieldMesh.MeshId = "http://www.roblox.com/asset/?id=397873198"
- ShieldMesh.TextureId = "rbxassetid://472409423"
- ShieldMesh.Scale = Vector3.new(2,2,2)
- ShieldMesh.Offset = Vector3.new(0,0,-2)
- local BubbleShield = Instance.new("Part",Torso)
- BubbleShield.Name = "Shield"
- BubbleShield.Shape = Enum.PartType.Ball
- BubbleShield.BrickColor = BrickColor.new("Carnation pink")
- BubbleShield.Transparency = 1
- BubbleShield.CanCollide = false
- BubbleShield.Material = "Neon"
- BubbleShield.Size = Vector3.new(12, 12, 12)
- BubbleShield.TopSurface = Enum.SurfaceType.Smooth
- BubbleShield.BottomSurface = Enum.SurfaceType.Smooth
- local ShieldWeld = Instance.new("Weld", BubbleShield)
- ShieldWeld.Part0 = Torso
- ShieldWeld.Part1 = BubbleShield
- ShieldWeld.C1 = CFrame.new(0,-2.5,0)
- local Gem = Instance.new("Part",Torso)
- Gem.Name = "Gem"
- Gem.Shape = Enum.PartType.Ball
- Gem.CanCollide = false
- Gem.BrickColor = BrickColor.new("Carnation pink")
- Gem.Transparency = 1
- Gem.Material = "DiamondPlate"
- Gem.Size = Vector3.new(0.1, 0.1, 0.1)
- Gem.TopSurface = Enum.SurfaceType.Smooth
- Gem.BottomSurface = Enum.SurfaceType.Smooth
- local GemWeld = Instance.new("Weld", Gem)
- GemWeld.Part0 = Torso
- GemWeld.Part1 = Gem
- GemWeld.C1 = CFrame.new(0,-0.3,0.5)*CFrame.fromEulerAnglesXYZ(math.rad(90),math.rad(0),math.rad(0))
- GemMesh = Instance.new("FileMesh",Gem)
- GemMesh.MeshId = "http://www.roblox.com/asset/?id=511706016"
- --GemMesh.TextureId = "http://www.roblox.com/asset/?id=74620702"
- GemMesh.Scale = Vector3.new(0.025,0.04,0.025)
- Pants = Instance.new("Pants",Character)
- Pants.PantsTemplate = "rbxassetid://234076241"
- Character['Body Colors'].HeadColor=BrickColor.new("Pastel brown")
- Character['Body Colors'].TorsoColor=BrickColor.new("Pastel brown")
- Character['Body Colors'].RightArmColor=BrickColor.new("Pastel brown")
- Character['Body Colors'].LeftArmColor=BrickColor.new("Pastel brown")
- Character['Body Colors'].RightLegColor=BrickColor.new("Pastel brown")
- Character['Body Colors'].LeftLegColor=BrickColor.new("Pastel brown")
- Humanoid.DisplayDistanceType='None'
- attack = false
- Shielding = false
- mouse.KeyDown:connect(function(key)
- if key == "f" and attack == false and Shielding == false then
- Shielding = true
- Shirt.Size = Vector3.new(2.1,1.1,1.03)
- Gem.Transparency = 0
- Shield.Transparency = 0
- Shield.CanCollide = true
- local ShirtWeld = Instance.new("Weld", Shirt)
- ShirtWeld.Part0 = Torso
- ShirtWeld.Part1 = Shirt
- ShirtWeld.C1 = CFrame.new(0,-0.46,0)
- RolledUpShirt.Transparency = 0
- BackShirt.Transparency = 0
- Shirt2.Transparency = 0
- end
- end)
- mouse.KeyUp:connect(function(key)
- if key == "f" and attack == false then
- Shielding = false
- Shirt.Size = Vector3.new(2.1,2.02,1.03)
- Gem.Transparency = 1
- Shield.Transparency = 1
- Shield.CanCollide = false
- local ShirtWeld = Instance.new("Weld", Shirt)
- ShirtWeld.Part0 = Torso
- ShirtWeld.Part1 = Shirt
- ShirtWeld.C1 = CFrame.new(0,0,0)
- RolledUpShirt.Transparency = 1
- BackShirt.Transparency = 1
- Shirt2.Transparency = 1
- end
- end)
- mouse.KeyDown:connect(function(key)
- if key == "r" and attack == false and Shielding == false then
- S = Instance.new("Sound")
- S.Parent = rootPart
- S.SoundId = "rbxassetid://282061274"
- S.Volume = 10
- S.Looped = false
- S.TimePosition = 0.05
- S.Pitch = 1
- S:Play()
- Shielding = true
- BubbleShield.Transparency = 1
- for i = 1,10 do
- BubbleShield.Transparency = BubbleShield.Transparency - 0.05
- swait()
- end
- BubbleShield.Transparency = 0.5
- BubbleShield.CanCollide = true
- local MagicFX = Instance.new("ParticleEmitter", BubbleShield)
- MagicFX.VelocitySpread = 0
- MagicFX.Lifetime = NumberRange.new(1)
- MagicFX.Speed = NumberRange.new(0)
- MagicFX.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.3, 0.3), NumberSequenceKeypoint.new(1, 0.1, 0.1)})
- MagicFX.RotSpeed = NumberRange.new(-180, 180)
- MagicFX.Rotation = NumberRange.new(-360, 360)
- MagicFX.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(0.2, 0), NumberSequenceKeypoint.new(0.8, 0), NumberSequenceKeypoint.new(1, 1)})
- MagicFX.LightEmission = 1
- MagicFX.Color = ColorSequence.new(Color3.fromRGB(255, 152, 220), Color3.fromRGB(255, 152, 220))
- MagicFX.Rate = 1500
- BubbleShield.Transparency = 0.5
- Spawn(function()
- wait(1)
- MagicFX.Rate = 0
- wait(1)
- MagicFX:Destroy()
- end)
- end
- end)
- mouse.KeyUp:connect(function(key)
- if key == "r" and attack == false then
- S = Instance.new("Sound")
- S.Parent = rootPart
- S.SoundId = "rbxassetid://1622853765"
- S.Volume = 10
- S.Looped = false
- S.Pitch = 1.5
- S:Play()
- BubbleShield.Transparency = 0.5
- Shielding = false
- for i = 1,5 do
- BubbleShield.Transparency = BubbleShield.Transparency + 0.1
- swait()
- end
- BubbleShield.Transparency = 1
- BubbleShield.CanCollide = false
- local MagicFX = Instance.new("ParticleEmitter", BubbleShield)
- MagicFX.VelocitySpread = 0
- MagicFX.Lifetime = NumberRange.new(0.1)
- MagicFX.Speed = NumberRange.new(0)
- MagicFX.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 1, 0.3), NumberSequenceKeypoint.new(1, 0.1, 0.1)})
- MagicFX.RotSpeed = NumberRange.new(-180, 180)
- MagicFX.Rotation = NumberRange.new(-360, 360)
- MagicFX.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(0.2, 0), NumberSequenceKeypoint.new(0.8, 0), NumberSequenceKeypoint.new(1, 1)})
- MagicFX.LightEmission = 1
- MagicFX.Color = ColorSequence.new(Color3.fromRGB(255, 152, 220), Color3.fromRGB(255, 152, 220))
- MagicFX.Rate = 1500
- BubbleShield.Transparency = 1
- Spawn(function()
- wait(0.3)
- MagicFX.Rate = 0
- wait(1)
- MagicFX:Destroy()
- end)
- end
- end)
- sine = 0
- change = 1
- sprint=false
- local punches={
- a=false,
- b=false,
- c=false
- }
- UIService.InputBegan:connect(function(Input,GUIProcessed)
- if not GUIProcessed and Input.UserInputType==Enum.UserInputType.MouseButton1 then
- if punches.a==false then
- punches.a=true wait(.4) punches.a=false
- else
- punches.a=true
- print('a ',punches.a)
- if punches.b==false then
- punches.b=true wait(.4) punches.b=false
- else
- punches.b=true
- print('b ',punches.b)
- if punches.c==false then
- punches.c=true wait(.4) punches.c=false
- else
- punches.c=true
- print('c ',punches.c)
- print('a ',punches.a,'b ',punches.b,'c ',punches.c)
- end
- end
- end
- elseif not GUIProcessed and Input.KeyCode==Enum.KeyCode.LeftShift then
- sprint=true
- end
- end)
- UIService.InputEnded:connect(function(Input,GUIProcessed)
- if not GUIProcessed and Input.KeyCode==Enum.KeyCode.LeftShift then
- sprint=false
- end
- end)
- game:GetService("RunService").RenderStepped:connect(function()
- Angle = (Angle % 100) + angleSpeed/10
- Axis = (Axis % 100) + axisSpeed/10
- walkingMagnitude = Vector3.new(rootPart.Velocity.X, 0, rootPart.Velocity.Z).magnitude
- jumpVel = Torso.Velocity.Y
- sine = change + sine
- if(Humanoid.Jump) and jumpVel > 1 then
- currentAnim = "Jumping"
- elseif walkingMagnitude < 2 then
- currentAnim = "Idling"
- elseif isSprinting == true then
- currentAnim = "Sprinting"
- elseif walkingMagnitude > 2 then
- currentAnim = "Walking"
- elseif isAttacking == true then
- currentAnim = "Attacking"
- end
- if currentAnim == "Jumping" and Animations == false then
- angleSpeed = 2
- axisSpeed = 2
- RA_Weld.C0 = clerp(RA_Weld.C0, c_new(1.5, 0.5, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
- LA_Weld.C0 = clerp(LA_Weld.C0, c_new(-1.5, 0.5, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
- LL_Weld.C0 = clerp(LL_Weld.C0, c_new(-0.5, -1, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
- RL_Weld.C0 = clerp(RL_Weld.C0, c_new(0.5, -1, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
- Torso_Weld.C0 = clerp(Torso_Weld.C0, c_new(0, -1, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
- Head_Weld.C0 = clerp(Head_Weld.C0, c_new(0, 1.5, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
- elseif currentAnim == "Idling" and Animations == false then
- angleSpeed = 1
- axisSpeed = 1
- change = 0.5
- RA_Weld.C0 = clerp(RA_Weld.C0, c_new(1.5, 0.65 + math.sin(sine/15)/10, 0) * c_angles(math.rad(0),math.rad(0),math.rad(20) - math.sin(sine/15)/10), 0.15)
- LA_Weld.C0 = clerp(LA_Weld.C0, c_new(-1.5, 0.65 + math.sin(sine/15)/10, 0) * c_angles(math.rad(0),math.rad(0),math.rad(-20) + math.sin(sine/15)/10), 0.15)
- LL_Weld.C0 = clerp(LL_Weld.C0, c_new(-0.5, -1 - math.sin(sine/15)/10, 0) * c_angles(math.rad(0),math.rad(0),math.rad(0)), 0.15)
- RL_Weld.C0 = clerp(RL_Weld.C0, c_new(0.5, -1 - math.sin(sine/15)/10, 0) * c_angles(math.rad(0),math.rad(0),math.rad(0)), 0.15)
- Torso_Weld.C0 = clerp(Torso_Weld.C0, c_new(0, -1 + math.sin(sine/15)/10, 0) * c_angles(math.rad(0), math.rad(0),math.rad(0)), 0.15)
- Head_Weld.C0 = clerp(Head_Weld.C0, c_new(0, 1.5, 0) * c_angles(math.rad(0),math.rad(0),math.rad(0)), 0.15)
- elseif currentAnim == "Walking" and Animations == false then
- if sprint==false then
- angleSpeed = 1
- axisSpeed = 1
- Humanoid.WalkSpeed = 8
- RA_Weld.C0 = clerp(RA_Weld.C0, c_new(1.5, 0.5 + math.sin(sine/15)/10, 0) * c_angles(math.rad(0) + math.sin(sine/4)/6, math.rad(0),math.rad(5)), 0.15)
- LA_Weld.C0 = clerp(LA_Weld.C0, c_new(-1.5, 0.5 + math.sin(sine/15)/10, 0) * c_angles(math.rad(0) - math.sin(sine/4)/6, math.rad(0),math.rad(-5)), 0.15)
- LL_Weld.C0 = clerp(LL_Weld.C0, c_new(-0.5, -1 + (-math.sin(sine/15)/10), 0) * c_angles(math.sin(sine/4)/3, math.sin((rootPart.RotVelocity.Y/10))/2, -math.sin((rootPart.RotVelocity.Y/10))/2), 0.15)
- RL_Weld.C0 = clerp(RL_Weld.C0, c_new(0.5, -1 + (-math.sin(sine/15)/10), 0) * c_angles(-math.sin(sine/4)/3, -math.sin((rootPart.RotVelocity.Y/10))/2, math.sin((-rootPart.RotVelocity.Y/10))/2), 0.15)
- Torso_Weld.C0 = clerp(Torso_Weld.C0, c_new(0, -1 + math.sin(sine/15)/10, 0) * c_angles(math.rad(0), math.rad(0), math.sin((rootPart.RotVelocity.Y/30))/2), 0.15)
- Head_Weld.C0 = clerp(Head_Weld.C0, c_new(0, 1.5, 0 + math.sin(sine/15)/10) * c_angles(math.rad(0) + math.sin(sine/15)/10, math.sin((rootPart.RotVelocity.Y/2.5))/2, math.rad(0)), 0.15)
- else
- angleSpeed = 10
- axisSpeed = 10
- Humanoid.WalkSpeed = 18
- RA_Weld.C0 = clerp(RA_Weld.C0, c_new(1.5, 0.5 + math.sin(sine/1.5)/5, 0) * c_angles(math.sin(sine/3)/1, math.rad(0),math.rad(10)), 0.15)
- LA_Weld.C0 = clerp(LA_Weld.C0, c_new(-1.5, 0.5 + math.sin(sine/1.5)/5, 0) * c_angles(-math.sin(sine/3)/1, math.rad(0),math.rad(-10)), 0.15)
- LL_Weld.C0 = clerp(LL_Weld.C0, c_new(-0.5, -1, 0) * c_angles(math.sin(sine/3)/1, math.rad(0), math.rad(0)), 0.15)
- RL_Weld.C0 = clerp(RL_Weld.C0, c_new(0.5, -1, 0) * c_angles(-math.sin(sine/3)/1, math.rad(0), math.rad(0)), 0.15)
- Torso_Weld.C0 = clerp(Torso_Weld.C0, c_new(0, -1 + math.sin(sine/1.5)/5, 0) * c_angles(math.rad(-20) + math.sin(sine/3)/20, math.rad(0), math.sin((rootPart.RotVelocity.Y/15))/2), 0.15)
- Head_Weld.C0 = clerp(Head_Weld.C0, c_new(0, 1.5, 0) * c_angles(math.rad(20), math.sin((rootPart.RotVelocity.Y/1))/2, math.rad(0)), 0.15)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement