Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- local chil = workspace:GetChildren()
- for i,v in pairs(chil) do
- if not (v==script or v:IsA("Camera") or v:IsA("Terrain") or game:GetService("Players"):GetPlayerFromCharacter(v)~=nil) then
- v:Destroy()
- end
- end
- Part0 = Instance.new("Part")
- Backpack1 = Instance.new("Backpack")
- Backpack2 = Instance.new("Backpack")
- Tool3 = Instance.new("Tool")
- BoolValue4 = Instance.new("BoolValue")
- BoolValue5 = Instance.new("BoolValue")
- BoolValue6 = Instance.new("BoolValue")
- Part7 = Instance.new("Part")
- SpecialMesh8 = Instance.new("SpecialMesh")
- Fire9 = Instance.new("Fire")
- PointLight10 = Instance.new("PointLight")
- PointLight11 = Instance.new("PointLight")
- Sparkles12 = Instance.new("Sparkles")
- Sound13 = Instance.new("Sound")
- Sound14 = Instance.new("Sound")
- Sound15 = Instance.new("Sound")
- Sound16 = Instance.new("Sound")
- Sound17 = Instance.new("Sound")
- Sound18 = Instance.new("Sound")
- Animation19 = Instance.new("Animation")
- Animation20 = Instance.new("Animation")
- Animation21 = Instance.new("Animation")
- Animation22 = Instance.new("Animation")
- Animation23 = Instance.new("Animation")
- Animation24 = Instance.new("Animation")
- Script25 = Instance.new("Script")
- LocalScript26 = Instance.new("LocalScript")
- LocalScript27 = Instance.new("LocalScript")
- LocalScript28 = Instance.new("LocalScript")
- Fire29 = Instance.new("Fire")
- Animation30 = Instance.new("Animation")
- Script31 = Instance.new("Script")
- Script32 = Instance.new("Script")
- Part0.Name = "Baseplate"
- Part0.Parent = workspace
- Part0.BrickColor = BrickColor.new("Dark stone grey")
- Part0.Anchored = true
- Part0.Locked = true
- Part0.FormFactor = Enum.FormFactor.Symmetric
- Part0.Size = Vector3.new(512, 20, 512)
- Part0.CFrame = CFrame.new(0, -10, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part0.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part0.Position = Vector3.new(0, -10, 0)
- Part0.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Backpack1.Name = "_CPData"
- Backpack1.Parent = mas
- Backpack2.Name = "_CPData"
- Backpack2.Parent = mas
- Tool3.Name = "AzureSword"
- Tool3.Parent = mas
- Tool3.TextureId = "http://www.roblox.com/asset/?id=120894242"
- Tool3.GripPos = Vector3.new(0, -2.29999995, 0)
- Tool3.ToolTip = "Press E to summon, mi'lord."
- BoolValue4.Name = "PlayOverhead"
- BoolValue4.Parent = Tool3
- BoolValue4.Value = true
- BoolValue5.Name = "PlaySlash"
- BoolValue5.Parent = Tool3
- BoolValue5.Value = true
- BoolValue6.Name = "PlayThrust"
- BoolValue6.Parent = Tool3
- Part7.Name = "Handle"
- Part7.Parent = Tool3
- Part7.BrickColor = BrickColor.new("Really black")
- Part7.Reflectance = 1
- Part7.Rotation = Vector3.new(-115.290001, 58.3499985, 104.279999)
- Part7.FormFactor = Enum.FormFactor.Custom
- Part7.Size = Vector3.new(0.200000003, 5.99999857, 0.600000024)
- Part7.CFrame = CFrame.new(3.18991494, 2.71859503, -21.0170918, -0.129414797, -0.508500516, 0.851280689, -0.224160001, 0.85127914, 0.474421859, -0.965921283, -0.129425809, -0.224153638)
- Part7.BottomSurface = Enum.SurfaceType.Smooth
- Part7.TopSurface = Enum.SurfaceType.Smooth
- Part7.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part7.Position = Vector3.new(3.18991494, 2.71859503, -21.0170918)
- Part7.Orientation = Vector3.new(-28.3199997, 104.75, -14.75)
- Part7.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- SpecialMesh8.Parent = Part7
- SpecialMesh8.MeshId = "http://www.roblox.com/asset/?id=94840342"
- SpecialMesh8.Scale = Vector3.new(0.850000024, 0.850000024, 0.850000024)
- SpecialMesh8.TextureId = "http://www.roblox.com/asset/?id=120869251"
- SpecialMesh8.MeshType = Enum.MeshType.FileMesh
- SpecialMesh8.Scale = Vector3.new(0.850000024, 0.850000024, 0.850000024)
- Fire9.Parent = Part7
- Fire9.Size = 2
- Fire9.Color = Color3.new(0.666667, 0, 1)
- Fire9.Heat = 25
- Fire9.SecondaryColor = Color3.new(0.666667, 0.333333, 1)
- Fire9.Color = Color3.new(0.666667, 0, 1)
- PointLight10.Parent = Part7
- PointLight10.Color = Color3.new(0.666667, 0, 1)
- PointLight10.Brightness = 0.20000000298023
- PointLight10.Range = 30
- PointLight10.Shadows = true
- PointLight10.Color = Color3.new(0.666667, 0, 1)
- PointLight11.Parent = Part7
- PointLight11.Color = Color3.new(0.72549, 0.278431, 1)
- PointLight11.Brightness = 0.75
- PointLight11.Range = 15
- PointLight11.Shadows = true
- PointLight11.Color = Color3.new(0.72549, 0.278431, 1)
- Sparkles12.Parent = Part7
- Sparkles12.Color = Color3.new(0.388889, 0, 0.309804)
- Sparkles12.SparkleColor = Color3.new(0.219608, 0, 0.309804)
- Sparkles12.Color = Color3.new(0.388889, 0, 0.309804)
- Sound13.Name = "Gong"
- Sound13.Parent = Part7
- Sound13.Pitch = 0.75
- Sound13.SoundId = "http://www.roblox.com/asset/?id=11984254"
- Sound13.Volume = 1
- Sound14.Name = "HitSound"
- Sound14.Parent = Part7
- Sound14.Pitch = 0.80000001192093
- Sound14.SoundId = "http://www.roblox.com/Asset?ID=96667969"
- Sound14.Volume = 0.75
- Sound15.Name = "LungeSound"
- Sound15.Parent = Part7
- Sound15.Pitch = 0.80000001192093
- Sound15.SoundId = "rbxasset://sounds//swordlunge.wav"
- Sound15.Volume = 0.25
- Sound16.Name = "OverheadSound"
- Sound16.Parent = Part7
- Sound16.Pitch = 0.94999998807907
- Sound16.SoundId = "rbxasset://sounds//swordslash.wav"
- Sound17.Name = "SlashSound"
- Sound17.Parent = Part7
- Sound17.Pitch = 0.80000001192093
- Sound17.SoundId = "rbxasset://sounds//swordslash.wav"
- Sound17.Volume = 0.34999999403954
- Sound18.Name = "UnsheathSound"
- Sound18.Parent = Part7
- Sound18.SoundId = "http://www.roblox.com/asset/?id=134747889"
- Sound18.Volume = 0.75
- Animation19.Name = "IdleAnim3"
- Animation19.Parent = Tool3
- Animation19.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
- Animation20.Name = "OverheadAnim2"
- Animation20.Parent = Tool3
- Animation20.AnimationId = "http://www.roblox.com/Asset?ID=94160738"
- Animation21.Name = "SlashAnim2"
- Animation21.Parent = Tool3
- Animation21.AnimationId = "http://www.roblox.com/Asset?ID=94161088"
- Animation22.Name = "ThrustAnim2"
- Animation22.Parent = Tool3
- Animation22.AnimationId = "http://www.roblox.com/Asset?ID=94161333"
- Animation23.Name = "UnequipAnim2"
- Animation23.Parent = Tool3
- Animation23.AnimationId = "http://www.roblox.com/Asset?ID=94095929"
- Animation24.Name = "EquipAnim5"
- Animation24.Parent = Tool3
- Animation24.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
- Script25.Name = "SwordSwing"
- Script25.Parent = Tool3
- table.insert(cors,sandbox(Script25,function()
- r = game:service("RunService")
- local damage = 0
- sword = script.Parent.Handle
- Tool = script.Parent
- local damages,values,sounds = {35,50,75},{Tool.PlaySlash,Tool.PlayThrust,Tool.PlayOverhead},{Tool.Handle.SlashSound,Tool.Handle.OverheadSound,Tool.Handle.LungeSound}
- local enabledToDamage = true
- function blow(hit)
- if enabledToDamage == false then return end
- enabledToDamage = false
- if (hit.Parent == nil) then enabledToDamage = true return end -- happens when bullet hits sword
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
- if humanoid~=nil and humanoid ~= hum and hum ~= nil then
- -- final check, make sure sword is in-hand
- local right_arm = vCharacter:FindFirstChild("Right Arm")
- if (right_arm ~= nil) then
- local joint = right_arm:FindFirstChild("RightGrip")
- if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(damage)
- wait(1)
- untagHumanoid(humanoid)
- else
- enabledToDamage = true
- end
- else
- enabledToDamage = true
- end
- else
- enabledToDamage = true
- end
- end
- function tagHumanoid(humanoid, player)
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = player
- creator_tag.Name = "creator"
- creator_tag.Parent = humanoid
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- function attack()
- damage = slash_damage
- script.Parent.Handle.SlashSound:Play()
- script.Parent.PlaySlash.Value = not script.Parent.PlaySlash.Value
- end
- function lunge()
- damage = lunge_damage
- script.Parent.Handle.LungeSound:Play()
- script.Parent.PlayOverhead.Value = not script.Parent.PlayOverhead.Value
- force = Instance.new("BodyVelocity")
- force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
- force.Parent = Tool.Parent.Torso
- wait(.5)
- force.Parent = nil
- wait(.5)
- damage = slash_damage
- end
- Tool.Enabled = true
- local last_attack = 0
- local status = 0
- function onActivated()
- if not Tool.Enabled then
- return
- end
- Tool.Enabled = false
- local character = Tool.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- t = r.Stepped:wait()
- if (t - last_attack < 1.5) then
- if status == 3 then
- status = 0
- damage = 0
- else
- status = status + 1
- values[status].Value = not values[status].Value
- damage = damages[status]
- sounds[status]:Play()
- enabledToDamage = true
- wait(0.5)
- enabledToDamage = false
- end
- else
- status = 0
- damage = 0
- end
- last_attack = t
- Tool.Enabled = true
- end
- function onEquipped()
- wait(1/3)
- Tool.Handle.UnsheathSound:Play()
- end
- Tool.Equipped:connect(onEquipped)
- script.Parent.Activated:connect(onActivated)
- connection = sword.Touched:connect(blow)
- end))
- LocalScript26.Name = "AnimationScript"
- LocalScript26.Parent = Tool3
- table.insert(cors,sandbox(LocalScript26,function()
- -- Waits for the child of the specified parent
- local function WaitForChild(parent, childName)
- while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
- return parent[childName]
- end
- local Tool = script.Parent
- local Animations = {}
- local MyHumanoid
- local MyCharacter
- local function PlayAnimation(animationName)
- if Animations[animationName] then
- Animations[animationName]:Play()
- end
- end
- local function StopAnimation(animationName)
- if Animations[animationName] then
- Animations[animationName]:Stop()
- end
- end
- function OnEquipped(mouse)
- MyCharacter = Tool.Parent
- MyHumanoid = WaitForChild(MyCharacter, 'Humanoid')
- if MyHumanoid then
- Animations['EquipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'EquipAnim5'))
- Animations['IdleAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
- Animations['OverheadAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'OverheadAnim2'))
- Animations['SlashAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'SlashAnim2'))
- Animations['ThrustAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'ThrustAnim2'))
- Animations['UnequipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'UnequipAnim2'))
- end
- PlayAnimation('EquipAnim')
- PlayAnimation('IdleAnim')
- end
- function OnUnequipped()
- for animName, _ in pairs(Animations) do
- StopAnimation(animName)
- end
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Unequipped:connect(OnUnequipped)
- WaitForChild(Tool, 'PlaySlash').Changed:connect(
- function (value)
- --if value then
- PlayAnimation('SlashAnim')
- --else
- -- StopAnimation('SlashAnim')
- --end
- end)
- WaitForChild(Tool, 'PlayThrust').Changed:connect(
- function (value)
- --if value then
- PlayAnimation('ThrustAnim')
- --else
- -- StopAnimation('ThrustAnim')
- --end
- end)
- WaitForChild(Tool, 'PlayOverhead').Changed:connect(
- function (value)
- --if value then
- PlayAnimation('OverheadAnim')
- --else
- -- StopAnimation('OverheadAnim')
- --end
- end)
- end))
- LocalScript27.Name = "Local Gui"
- LocalScript27.Parent = Tool3
- table.insert(cors,sandbox(LocalScript27,function()
- local Tool = script.Parent;
- enabled = true
- function onButton1Down(mouse)
- if not enabled then
- return
- end
- enabled = false
- mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
- while not Tool.Enabled do
- wait(0.05)
- end
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- enabled = true
- end
- function onEquippedLocal(mouse)
- if mouse == nil then
- print("Mouse not found")
- return
- end
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- mouse.Button1Down:connect(function() onButton1Down(mouse) end)
- end
- Tool.Equipped:connect(onEquippedLocal)
- end))
- LocalScript28.Name = "RaiseSkeletons"
- LocalScript28.Parent = Tool3
- table.insert(cors,sandbox(LocalScript28,function()
- -----------------
- --| Constants |--
- -----------------
- local SPAWN_RADIUS = 8 -- Studs
- local SUMMON_COOLDOWN = 16
- local SKELETON_ASSET_ID = 132805224
- local SKELETON_DURATION = 60
- --------------------
- --| WaitForChild |--
- --------------------
- -- Waits for parent.child to exist, then returns it
- local function WaitForChild(parent, childName)
- assert(parent, "ERROR: WaitForChild: parent is nil")
- while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
- return parent[childName]
- end
- -----------------
- --| Variables |--
- -----------------
- local InsertService = Game:GetService('InsertService')
- local DebrisService = Game:GetService('Debris')
- local PlayersService = Game:GetService('Players')
- local Tool = script.Parent
- local ToolHandle = Tool.Handle
- local MyPlayer = PlayersService.LocalPlayer
- local SkeletonScript = WaitForChild(script, 'SkeletonScript')
- local Fire = WaitForChild(script, 'Fire')
- local SummonAnimation = WaitForChild(script, 'Summon')
- local GongSound = WaitForChild(ToolHandle, 'Gong')
- local MyModel = nil
- local Skeleton = nil
- local LastSummonTime = 0
- local SummonTrack = nil
- -----------------
- --| Functions |--
- -----------------
- local function MakeSkeleton()
- Skeleton = InsertService:LoadAsset(SKELETON_ASSET_ID):GetChildren()[1]
- if Skeleton then
- local head = Skeleton:FindFirstChild('Head')
- if head then
- head.Transparency = 1
- end
- local skeletonScriptClone = SkeletonScript:Clone()
- skeletonScriptClone.Parent = Skeleton
- skeletonScriptClone.Disabled = false
- local creatorTag = Instance.new('ObjectValue')
- creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
- creatorTag.Value = MyPlayer
- local iconTag = Instance.new('StringValue', creatorTag)
- iconTag.Name = 'icon'
- iconTag.Value = Tool.TextureId
- creatorTag.Parent = Skeleton
- end
- end
- local function SpawnSkeleton(spawnPosition)
- if Skeleton then
- -- Hellfire
- local firePart = Instance.new('Part')
- firePart.Name = 'Effect'
- firePart.Transparency = 1
- firePart.FormFactor = Enum.FormFactor.Custom
- firePart.Size = Vector3.new()
- firePart.Anchored = true
- firePart.CanCollide = false
- firePart.CFrame = CFrame.new(spawnPosition - Vector3.new(0, 4, 0))
- local fireClone = Fire:Clone()
- fireClone.Parent = firePart
- Delay(0.5, function()
- if fireClone then
- fireClone.Enabled = false
- end
- end)
- DebrisService:AddItem(firePart, 3)
- firePart.Parent = Workspace
- -- Spawn
- local skeletonClone = Skeleton:Clone()
- DebrisService:AddItem(skeletonClone, SKELETON_DURATION)
- skeletonClone.Parent = Workspace
- skeletonClone:MoveTo(spawnPosition) --NOTE: Model must be in Workspace
- -- Rise!
- local torso = skeletonClone:FindFirstChild('Torso')
- if torso then
- torso.CFrame = torso.CFrame - Vector3.new(0, 4.5, 0)
- for i = 0, 4.5, 0.45 do
- torso.CFrame = torso.CFrame + Vector3.new(0, i, 0)
- wait(1/30)
- end
- end
- end
- end
- local function RaiseSkeletons()
- if not Skeleton then -- Try again
- MakeSkeleton()
- end
- for theta = -135, -45, 45 do
- SpawnSkeleton(MyModel.Torso.CFrame:pointToWorldSpace(Vector3.new(math.cos(theta), 0, math.sin(theta)) * SPAWN_RADIUS))
- end
- end
- --NOTE: Ugly!
- local function OnKeyDown(key)
- key = string.lower(key)
- if key == 'e' then
- local now = time()
- if now > LastSummonTime + SUMMON_COOLDOWN then
- LastSummonTime = now
- local humanoid = MyModel:FindFirstChild('Humanoid')
- if humanoid then
- humanoid.WalkSpeed = 0
- end
- Spawn(function()
- for i = 1, 3 do
- if GongSound then GongSound:Play() end
- wait(1.5)
- end
- end)
- if SummonTrack then
- SummonTrack:Play()
- wait(3.125)
- end
- RaiseSkeletons()
- wait(1)
- if humanoid then
- humanoid.WalkSpeed = 18
- end
- end
- end
- end
- local function OnEquipped(mouse)
- MyModel = Tool.Parent
- mouse.KeyDown:connect(OnKeyDown)
- local humanoid = MyModel:FindFirstChild('Humanoid')
- if humanoid then -- Preload animations
- SummonTrack = humanoid:LoadAnimation(SummonAnimation)
- end
- end
- local function OnUnequipped()
- if SummonTrack then SummonTrack:Stop() end
- end
- --------------------
- --| Script Logic |--
- --------------------
- MakeSkeleton()
- Tool.Equipped:connect(OnEquipped)
- Tool.Unequipped:connect(OnUnequipped)
- end))
- Fire29.Parent = LocalScript28
- Fire29.Size = 10
- Fire29.Color = Color3.new(0.666667, 0, 1)
- Fire29.Heat = 25
- Fire29.SecondaryColor = Color3.new(0.666667, 0.333333, 1)
- Fire29.Color = Color3.new(0.666667, 0, 1)
- Animation30.Name = "Summon"
- Animation30.Parent = LocalScript28
- Animation30.AnimationId = "http://www.roblox.com/Asset?ID=93693205"
- Script31.Name = "SkeletonScript"
- Script31.Parent = LocalScript28
- Script31.Disabled = true
- table.insert(cors,sandbox(Script31,function()
- --Made by Stickmasterluke
- --Zombie artificial stupidity script
- --(Modified for skeletons)
- sp=script.Parent
- lastattack=0
- nextrandom=0
- --nextsound=0
- nextjump=0
- chasing=false
- variance=4
- damage=26
- attackrange=5
- sightrange=100
- runspeed=26
- wonderspeed=16
- healthregen=true
- colors={"Really black"}
- function raycast(spos,vec,currentdist)
- local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(spos+(vec*.01),vec*currentdist),sp)
- if hit2~=nil and pos2 then
- if hit2.Transparency>=.8 or hit2.Name=="Handle" or string.sub(hit2.Name,1,6)=="Effect" then
- local currentdist=currentdist-(pos2-spos).magnitude
- return raycast(pos2,vec,currentdist)
- end
- end
- return hit2,pos2
- end
- 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 Torso=waitForChild(sp,"Torso")
- local Head=waitForChild(sp,"Head")
- 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(sp,"Humanoid")
- local BodyColors=waitForChild(sp,"Body Colors")
- local pose="Standing"
- --local hitsound=waitForChild(Torso,"HitSound")
- --[[
- local sounds={
- waitForChild(Torso,"GroanSound"),
- waitForChild(Torso,"RawrSound")
- }
- --]]
- if healthregen then
- local regenscript=waitForChild(sp,"HealthRegenerationScript")
- regenscript.Disabled=false
- end
- Humanoid.WalkSpeed=wonderspeed
- local toolAnim="None"
- local toolAnimTime=0
- BodyColors.HeadColor=BrickColor.new("Grime")
- local randomcolor1=colors[math.random(1,#colors)]
- BodyColors.TorsoColor=BrickColor.new(randomcolor1)
- BodyColors.LeftArmColor=BrickColor.new(randomcolor1)
- BodyColors.RightArmColor=BrickColor.new(randomcolor1)
- local randomcolor2=colors[math.random(1,#colors)]
- BodyColors.LeftLegColor=BrickColor.new(randomcolor2)
- BodyColors.RightLegColor=BrickColor.new(randomcolor2)
- 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 moveJump()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- RightShoulder.DesiredAngle=3.14
- LeftShoulder.DesiredAngle=-3.14
- RightHip.DesiredAngle=0
- LeftHip.DesiredAngle=0
- end
- function moveFreeFall()
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity =0.5
- RightShoulder.DesiredAngle=3.14
- LeftShoulder.DesiredAngle=-3.14
- RightHip.DesiredAngle=0
- LeftHip.DesiredAngle=0
- end
- function moveSit()
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- RightShoulder.DesiredAngle=3.14 /2
- LeftShoulder.DesiredAngle=-3.14 /2
- RightHip.DesiredAngle=3.14 /2
- LeftHip.DesiredAngle=-3.14 /2
- end
- function animate(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.15
- LeftShoulder.MaxVelocity = 0.15
- amplitude = 1
- frequency = 9
- elseif (pose == "Climbing") then
- RightShoulder.MaxVelocity = 0.5
- LeftShoulder.MaxVelocity = 0.5
- amplitude = 1
- frequency = 9
- climbFudge = 3.14
- else
- amplitude = 0.1
- frequency = 1
- end
- desiredAngle = amplitude * math.sin(time*frequency)
- if not chasing and frequency==9 then
- frequency=4
- end
- if chasing then
- RightShoulder.DesiredAngle=math.pi/2
- LeftShoulder.DesiredAngle=-math.pi/2
- RightHip.DesiredAngle=-desiredAngle*2
- LeftHip.DesiredAngle=-desiredAngle*2
- else
- RightShoulder.DesiredAngle=desiredAngle + climbFudge
- LeftShoulder.DesiredAngle=desiredAngle - climbFudge
- RightHip.DesiredAngle=-desiredAngle
- LeftHip.DesiredAngle=-desiredAngle
- end
- end
- function attack(time,attackpos)
- if time-lastattack>=1 then
- local hit,pos=raycast(Torso.Position,(attackpos-Torso.Position).unit,attackrange)
- if hit and hit.Parent~=nil and hit.Parent.Name~=sp.Name then
- local h=hit.Parent:FindFirstChild("Humanoid")
- if h then
- local creator=sp:FindFirstChild("creator")
- if creator then
- if creator.Value~=nil then
- if creator.Value~=game.Players:GetPlayerFromCharacter(h.Parent) then
- for i,oldtag in ipairs(h:GetChildren()) do
- if oldtag.Name=="creator" then
- oldtag:remove()
- end
- end
- creator:clone().Parent=h
- else
- return
- end
- end
- end
- h:TakeDamage(damage)
- --[[
- hitsound.Volume=.5+(.5*math.random())
- hitsound.Pitch=.5+math.random()
- hitsound:Play()
- --]]
- if RightShoulder and LeftShoulder then
- RightShoulder.CurrentAngle=0
- LeftShoulder.CurrentAngle=0
- end
- end
- end
- lastattack=time
- end
- end
- 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)
- function populatehumanoids(mdl)
- if mdl.ClassName=="Humanoid" then
- table.insert(humanoids,mdl)
- end
- for i2,mdl2 in ipairs(mdl:GetChildren()) do
- populatehumanoids(mdl2)
- end
- end
- --[[
- function playsound(time)
- nextsound=time+5+(math.random()*5)
- local randomsound=sounds[math.random(1,#sounds)]
- randomsound.Volume=.5+(.5*math.random())
- randomsound.Pitch=.5+(.5*math.random())
- randomsound:Play()
- end
- --]]
- while sp.Parent~=nil and Humanoid and Humanoid.Parent~=nil and Humanoid.Health>0 and Torso and Head and Torso~=nil and Torso.Parent~=nil do
- local _,time=wait(1/3)
- humanoids={}
- populatehumanoids(game.Workspace)
- closesttarget=nil
- closestdist=sightrange
- local creator=sp:FindFirstChild("creator")
- for i,h in ipairs(humanoids) do
- if h and h.Parent~=nil then
- if h.Health>0 and h.Parent.Name~=sp.Name and h.Parent~=sp then
- local plr=game.Players:GetPlayerFromCharacter(h.Parent)
- if creator==nil or plr==nil or creator.Value~=plr then
- local t=h.Parent:FindFirstChild("Torso")
- if t~=nil then
- local dist=(t.Position-Torso.Position).magnitude
- if dist<closestdist then
- closestdist=dist
- closesttarget=t
- end
- end
- end
- end
- end
- end
- if closesttarget~=nil then
- if not chasing then
- --playsound(time)
- chasing=true
- Humanoid.WalkSpeed=runspeed
- end
- Humanoid:MoveTo(closesttarget.Position+(Vector3.new(1,1,1)*(variance*((math.random()*2)-1))),closesttarget)
- if math.random()<.5 then
- attack(time,closesttarget.Position)
- end
- else
- if chasing then
- chasing=false
- Humanoid.WalkSpeed=wonderspeed
- end
- if time>nextrandom then
- nextrandom=time+5+(math.random()*5)
- local randompos=Torso.Position+((Vector3.new(1,1,1)*math.random()-Vector3.new(math.random(),math.random(),math.random()))*40)
- Humanoid:MoveTo(randompos,game.Workspace.Terrain)
- end
- end
- --[[
- if time>nextsound then
- playsound(time)
- end
- --]]
- if time>nextjump then
- nextjump=time+7+(math.random()*5)
- Humanoid.Jump=true
- end
- animate(time)
- end
- wait(4)
- sp:remove() --Rest In Pizza
- end))
- Script32.Name = "SwordScript"
- Script32.Parent = Tool3
- table.insert(cors,sandbox(Script32,function()
- -- Copied from Grimgold Periastron Beta
- local Tool = script.Parent
- local Sword = Tool.Handle
- local vCharacter
- local myTorso
- local myHumanoid
- local equipped = false
- local debris = game:GetService("Debris")
- function tagHumanoid(humanoid, player)
- if humanoid then
- local creatorTag = Instance.new("ObjectValue")
- creatorTag.Value = player
- creatorTag.Name = "creator"
- creatorTag.Parent = humanoid
- debris:AddItem(creatorTag, 1)
- end
- end
- function cut(hit)
- local humanoid
- local vPlayer
- if hit and hit.Parent and myHumanoid then
- if hit.Parent.className == "Hat" then
- humanoid = hit.Parent.Parent:FindFirstChild("Humanoid")
- else
- humanoid = hit.Parent:FindFirstChild("Humanoid")
- end
- vPlayer = game.Players:GetPlayerFromCharacter(vCharacter)
- if humanoid ~= nil and humanoid ~= myHumanoid then
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(7.5)
- end
- end
- end
- function onEquipped()
- vCharacter = Tool.Parent
- myTorso = vCharacter:FindFirstChild("Torso")
- myHumanoid = vCharacter:FindFirstChild("Humanoid")
- end
- Tool.Equipped:connect(onEquipped)
- Sword.Touched:connect(cut)
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Backpack
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement