920 lines
29 KiB
Plaintext
920 lines
29 KiB
Plaintext
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
|
|
<External>null</External>
|
|
<External>nil</External>
|
|
<Item class="Tool" referent="RBX0">
|
|
<Properties>
|
|
<bool name="CanBeDropped">true</bool>
|
|
<bool name="Enabled">true</bool>
|
|
<CoordinateFrame name="Grip">
|
|
<X>0</X>
|
|
<Y>-1.70000005</Y>
|
|
<Z>0</Z>
|
|
<R00>1</R00>
|
|
<R01>0</R01>
|
|
<R02>0</R02>
|
|
<R10>0</R10>
|
|
<R11>1</R11>
|
|
<R12>0</R12>
|
|
<R20>0</R20>
|
|
<R21>0</R21>
|
|
<R22>1</R22>
|
|
</CoordinateFrame>
|
|
<string name="Name">SpartanSword</string>
|
|
<Content name="TextureId"><url>http://www.roblox.com/asset/?id=96674782 </url></Content>
|
|
<string name="ToolTip"></string>
|
|
</Properties>
|
|
<Item class="Part" referent="RBX1">
|
|
<Properties>
|
|
<bool name="Anchored">false</bool>
|
|
<float name="BackParamA">-0.5</float>
|
|
<float name="BackParamB">0.5</float>
|
|
<token name="BackSurface">0</token>
|
|
<token name="BackSurfaceInput">0</token>
|
|
<float name="BottomParamA">-0.5</float>
|
|
<float name="BottomParamB">0.5</float>
|
|
<token name="BottomSurface">4</token>
|
|
<token name="BottomSurfaceInput">0</token>
|
|
<int name="BrickColor">194</int>
|
|
<CoordinateFrame name="CFrame">
|
|
<X>-9.80000019</X>
|
|
<Y>80.3000259</Y>
|
|
<Z>-45.8999977</Z>
|
|
<R00>0</R00>
|
|
<R01>0</R01>
|
|
<R02>-0.999999762</R02>
|
|
<R10>0</R10>
|
|
<R11>-0.999999762</R11>
|
|
<R12>0</R12>
|
|
<R20>-0.999999762</R20>
|
|
<R21>0</R21>
|
|
<R22>0</R22>
|
|
</CoordinateFrame>
|
|
<bool name="CanCollide">true</bool>
|
|
<float name="Elasticity">0.5</float>
|
|
<float name="Friction">0.300000012</float>
|
|
<float name="FrontParamA">-0.5</float>
|
|
<float name="FrontParamB">0.5</float>
|
|
<token name="FrontSurface">0</token>
|
|
<token name="FrontSurfaceInput">0</token>
|
|
<float name="LeftParamA">-0.5</float>
|
|
<float name="LeftParamB">0.5</float>
|
|
<token name="LeftSurface">0</token>
|
|
<token name="LeftSurfaceInput">0</token>
|
|
<bool name="Locked">false</bool>
|
|
<token name="Material">256</token>
|
|
<string name="Name">Handle</string>
|
|
<float name="Reflectance">0</float>
|
|
<float name="RightParamA">-0.5</float>
|
|
<float name="RightParamB">0.5</float>
|
|
<token name="RightSurface">0</token>
|
|
<token name="RightSurfaceInput">0</token>
|
|
<Vector3 name="RotVelocity">
|
|
<X>0</X>
|
|
<Y>0</Y>
|
|
<Z>0</Z>
|
|
</Vector3>
|
|
<float name="TopParamA">-0.5</float>
|
|
<float name="TopParamB">0.5</float>
|
|
<token name="TopSurface">3</token>
|
|
<token name="TopSurfaceInput">0</token>
|
|
<float name="Transparency">0</float>
|
|
<Vector3 name="Velocity">
|
|
<X>0</X>
|
|
<Y>0</Y>
|
|
<Z>0</Z>
|
|
</Vector3>
|
|
<token name="formFactorRaw">3</token>
|
|
<token name="shape">1</token>
|
|
<Vector3 name="size">
|
|
<X>0.200000003</X>
|
|
<Y>4.59999609</Y>
|
|
<Z>0.400000036</Z>
|
|
</Vector3>
|
|
</Properties>
|
|
<Item class="SpecialMesh" referent="RBX2">
|
|
<Properties>
|
|
<token name="LODX">2</token>
|
|
<token name="LODY">2</token>
|
|
<Content name="MeshId"><url>http://www.roblox.com/asset/?id=96669672</url></Content>
|
|
<token name="MeshType">5</token>
|
|
<string name="Name">Mesh</string>
|
|
<Vector3 name="Offset">
|
|
<X>0</X>
|
|
<Y>-1.60000002</Y>
|
|
<Z>0</Z>
|
|
</Vector3>
|
|
<Vector3 name="Scale">
|
|
<X>2</X>
|
|
<Y>2</Y>
|
|
<Z>2</Z>
|
|
</Vector3>
|
|
<Content name="TextureId"><url>http://www.roblox.com/asset/?id=96670715</url></Content>
|
|
<Vector3 name="VertexColor">
|
|
<X>1</X>
|
|
<Y>1</Y>
|
|
<Z>1</Z>
|
|
</Vector3>
|
|
</Properties>
|
|
</Item>
|
|
<Item class="Sound" referent="RBX3">
|
|
<Properties>
|
|
<bool name="Looped">false</bool>
|
|
<string name="Name">BashHit</string>
|
|
<float name="Pitch">1</float>
|
|
<bool name="PlayOnRemove">false</bool>
|
|
<Content name="SoundId"><url>http://www.roblox.com/Asset?ID=92597264</url></Content>
|
|
<float name="Volume">0.5</float>
|
|
</Properties>
|
|
</Item>
|
|
<Item class="Sound" referent="RBX4">
|
|
<Properties>
|
|
<bool name="Looped">false</bool>
|
|
<string name="Name">BashMiss</string>
|
|
<float name="Pitch">1</float>
|
|
<bool name="PlayOnRemove">false</bool>
|
|
<Content name="SoundId"><url>http://www.roblox.com/Asset?ID=92597296</url></Content>
|
|
<float name="Volume">0.300000012</float>
|
|
</Properties>
|
|
</Item>
|
|
<Item class="Sound" referent="RBX5">
|
|
<Properties>
|
|
<bool name="Looped">false</bool>
|
|
<string name="Name">PowerUp</string>
|
|
<float name="Pitch">1</float>
|
|
<bool name="PlayOnRemove">false</bool>
|
|
<Content name="SoundId"><url>http://www.roblox.com/Asset?ID=92597340</url></Content>
|
|
<float name="Volume">0.699999988</float>
|
|
</Properties>
|
|
</Item>
|
|
<Item class="Sound" referent="RBX6">
|
|
<Properties>
|
|
<bool name="Looped">false</bool>
|
|
<string name="Name">Slash</string>
|
|
<float name="Pitch">1</float>
|
|
<bool name="PlayOnRemove">false</bool>
|
|
<Content name="SoundId"><url>http://www.roblox.com/Asset?ID=96667910</url></Content>
|
|
<float name="Volume">0.5</float>
|
|
</Properties>
|
|
</Item>
|
|
<Item class="Sound" referent="RBX7">
|
|
<Properties>
|
|
<bool name="Looped">false</bool>
|
|
<string name="Name">Sprint</string>
|
|
<float name="Pitch">1</float>
|
|
<bool name="PlayOnRemove">false</bool>
|
|
<Content name="SoundId"><url>http://www.roblox.com/Asset?ID=92628581</url></Content>
|
|
<float name="Volume">1</float>
|
|
</Properties>
|
|
</Item>
|
|
<Item class="Sound" referent="RBX8">
|
|
<Properties>
|
|
<bool name="Looped">false</bool>
|
|
<string name="Name">SwordDraw</string>
|
|
<float name="Pitch">1</float>
|
|
<bool name="PlayOnRemove">false</bool>
|
|
<Content name="SoundId"><url>http://www.roblox.com/Asset?ID=96668951</url></Content>
|
|
<float name="Volume">0.300000012</float>
|
|
</Properties>
|
|
</Item>
|
|
<Item class="Sound" referent="RBX9">
|
|
<Properties>
|
|
<bool name="Looped">false</bool>
|
|
<string name="Name">SwordHit</string>
|
|
<float name="Pitch">1</float>
|
|
<bool name="PlayOnRemove">false</bool>
|
|
<Content name="SoundId"><url>http://www.roblox.com/Asset?ID=96667969</url></Content>
|
|
<float name="Volume">0.5</float>
|
|
</Properties>
|
|
</Item>
|
|
<Item class="Sound" referent="RBX10">
|
|
<Properties>
|
|
<bool name="Looped">false</bool>
|
|
<string name="Name">Kick</string>
|
|
<float name="Pitch">1</float>
|
|
<bool name="PlayOnRemove">false</bool>
|
|
<Content name="SoundId"><url>http://www.roblox.com/asset/?id=96626016</url></Content>
|
|
<float name="Volume">1</float>
|
|
</Properties>
|
|
</Item>
|
|
<Item class="Sound" referent="RBX11">
|
|
<Properties>
|
|
<bool name="Looped">false</bool>
|
|
<string name="Name">Yell</string>
|
|
<float name="Pitch">1</float>
|
|
<bool name="PlayOnRemove">false</bool>
|
|
<Content name="SoundId"><url>http://www.roblox.com/Asset?ID=96673085</url></Content>
|
|
<float name="Volume">1</float>
|
|
</Properties>
|
|
</Item>
|
|
</Item>
|
|
<Item class="Part" referent="RBX12">
|
|
<Properties>
|
|
<bool name="Anchored">false</bool>
|
|
<float name="BackParamA">-0.5</float>
|
|
<float name="BackParamB">0.5</float>
|
|
<token name="BackSurface">0</token>
|
|
<token name="BackSurfaceInput">0</token>
|
|
<float name="BottomParamA">-0.5</float>
|
|
<float name="BottomParamB">0.5</float>
|
|
<token name="BottomSurface">4</token>
|
|
<token name="BottomSurfaceInput">0</token>
|
|
<int name="BrickColor">194</int>
|
|
<CoordinateFrame name="CFrame">
|
|
<X>-10.0804014</X>
|
|
<Y>79.5143585</Y>
|
|
<Z>-46.2999992</Z>
|
|
<R00>0.866020083</R00>
|
|
<R01>0.50000912</R01>
|
|
<R02>0</R02>
|
|
<R10>-0.50000912</R10>
|
|
<R11>0.866020083</R11>
|
|
<R12>0</R12>
|
|
<R20>0</R20>
|
|
<R21>0</R21>
|
|
<R22>0.99999994</R22>
|
|
</CoordinateFrame>
|
|
<bool name="CanCollide">true</bool>
|
|
<float name="Elasticity">0.5</float>
|
|
<float name="Friction">0.300000012</float>
|
|
<float name="FrontParamA">-0.5</float>
|
|
<float name="FrontParamB">0.5</float>
|
|
<token name="FrontSurface">0</token>
|
|
<token name="FrontSurfaceInput">0</token>
|
|
<float name="LeftParamA">-0.5</float>
|
|
<float name="LeftParamB">0.5</float>
|
|
<token name="LeftSurface">0</token>
|
|
<token name="LeftSurfaceInput">0</token>
|
|
<bool name="Locked">false</bool>
|
|
<token name="Material">256</token>
|
|
<string name="Name">Shield</string>
|
|
<float name="Reflectance">0</float>
|
|
<float name="RightParamA">-0.5</float>
|
|
<float name="RightParamB">0.5</float>
|
|
<token name="RightSurface">0</token>
|
|
<token name="RightSurfaceInput">0</token>
|
|
<Vector3 name="RotVelocity">
|
|
<X>0</X>
|
|
<Y>0</Y>
|
|
<Z>0</Z>
|
|
</Vector3>
|
|
<float name="TopParamA">-0.5</float>
|
|
<float name="TopParamB">0.5</float>
|
|
<token name="TopSurface">3</token>
|
|
<token name="TopSurfaceInput">0</token>
|
|
<float name="Transparency">0</float>
|
|
<Vector3 name="Velocity">
|
|
<X>0</X>
|
|
<Y>0</Y>
|
|
<Z>0</Z>
|
|
</Vector3>
|
|
<token name="formFactorRaw">3</token>
|
|
<token name="shape">1</token>
|
|
<Vector3 name="size">
|
|
<X>3.39999962</X>
|
|
<Y>3.99999976</Y>
|
|
<Z>0.400000036</Z>
|
|
</Vector3>
|
|
</Properties>
|
|
<Item class="SpecialMesh" referent="RBX13">
|
|
<Properties>
|
|
<token name="LODX">2</token>
|
|
<token name="LODY">2</token>
|
|
<Content name="MeshId"><url>http://www.roblox.com/asset/?id=96670147</url></Content>
|
|
<token name="MeshType">5</token>
|
|
<string name="Name">Mesh</string>
|
|
<Vector3 name="Offset">
|
|
<X>0</X>
|
|
<Y>0</Y>
|
|
<Z>0</Z>
|
|
</Vector3>
|
|
<Vector3 name="Scale">
|
|
<X>3</X>
|
|
<Y>3</Y>
|
|
<Z>3</Z>
|
|
</Vector3>
|
|
<Content name="TextureId"><url>http://www.roblox.com/asset/?id=96670755</url></Content>
|
|
<Vector3 name="VertexColor">
|
|
<X>1</X>
|
|
<Y>1</Y>
|
|
<Z>1</Z>
|
|
</Vector3>
|
|
</Properties>
|
|
</Item>
|
|
<Item class="Weld" referent="RBX14">
|
|
<Properties>
|
|
<CoordinateFrame name="C0">
|
|
<X>0</X>
|
|
<Y>0</Y>
|
|
<Z>0</Z>
|
|
<R00>0.866020083</R00>
|
|
<R01>-0.50000912</R01>
|
|
<R02>0</R02>
|
|
<R10>0.50000912</R10>
|
|
<R11>0.866020083</R11>
|
|
<R12>0</R12>
|
|
<R20>0</R20>
|
|
<R21>0</R21>
|
|
<R22>0.99999994</R22>
|
|
</CoordinateFrame>
|
|
<CoordinateFrame name="C1">
|
|
<X>0.400001526</X>
|
|
<Y>0.785667419</Y>
|
|
<Z>0.28040123</Z>
|
|
<R00>0</R00>
|
|
<R01>0</R01>
|
|
<R02>-0.999999881</R02>
|
|
<R10>0</R10>
|
|
<R11>-0.999999881</R11>
|
|
<R12>0</R12>
|
|
<R20>-0.999999881</R20>
|
|
<R21>0</R21>
|
|
<R22>0</R22>
|
|
</CoordinateFrame>
|
|
<string name="Name">ShieldWeld</string>
|
|
<Ref name="Part0">RBX12</Ref>
|
|
<Ref name="Part1">RBX1</Ref>
|
|
</Properties>
|
|
</Item>
|
|
</Item>
|
|
<Item class="LocalScript" referent="RBX15">
|
|
<Properties>
|
|
<bool name="Disabled">false</bool>
|
|
<Content name="LinkedSource"><null></null></Content>
|
|
<string name="Name">SwordScript</string>
|
|
<ProtectedString name="Source">-------------- Sword Script ----------------
|
|
-- 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 PlayersService = Game:GetService('Players')
|
|
local DebrisService = Game:GetService('Debris')
|
|
|
|
local Tool = script.Parent
|
|
local Handle = WaitForChild(Tool, 'Handle')
|
|
local Shield = WaitForChild(Tool, 'Shield')
|
|
|
|
local SWORD_DAMAGE = 25
|
|
local STUN_BONUS = 10
|
|
|
|
------- MESH IDs -----------
|
|
-- Preload these meshes
|
|
local BladeOnlyMesh = 'http://www.roblox.com/asset/?id=92541982'
|
|
local SwordOnlyMesh = 'http://www.roblox.com/asset/?id=96669672'
|
|
local CompleteMesh = 'http://www.roblox.com/asset/?id=92542016'
|
|
----------------------------
|
|
|
|
------- Animations ---------
|
|
local ShieldBashAnim = WaitForChild(Tool, "ShieldBash")
|
|
local EquipAnim = WaitForChild(Tool, "EquipAnim")
|
|
local SlashAnim = WaitForChild(Tool, "QuickSlash")
|
|
local ShieldWalkAnim = WaitForChild(Tool, "ShieldWalk")
|
|
local KickAnim = WaitForChild(Tool, "Kick")
|
|
----------------------------
|
|
|
|
------- Sounds -------------
|
|
local BashHit = WaitForChild(Handle, "BashHit")
|
|
local BashMiss = WaitForChild(Handle, "BashMiss")
|
|
local PowerUp = WaitForChild(Handle, "PowerUp")
|
|
local Slash = WaitForChild(Handle, "Slash")
|
|
local Sprint = WaitForChild(Handle, "Sprint")
|
|
local SwordDraw = WaitForChild(Handle, "SwordDraw")
|
|
local SwordHit = WaitForChild(Handle, "SwordHit")
|
|
local KickSound = WaitForChild(Handle, "Kick")
|
|
local YellSound = WaitForChild(Handle, "Yell")
|
|
----------------------------
|
|
|
|
|
|
------- My Character Variables -------
|
|
local MyCharacter
|
|
local MyHumanoid
|
|
local MyPlayer
|
|
local MyTorso
|
|
local MyMouse
|
|
---------------------------------------
|
|
|
|
local KickedScript = WaitForChild(script, "KickedScript")
|
|
|
|
local UnequippedWeld = WaitForChild(Shield, 'ShieldWeld')
|
|
local UnequippedWeldCopy = UnequippedWeld:Clone()
|
|
local ArmShieldWeld
|
|
local BackWeld = nil
|
|
local RightGrip = nil
|
|
|
|
------- Connections ---------
|
|
local RightMouseConnection
|
|
local ShieldBlowConnection
|
|
local SwordBlowConnection
|
|
local MouseRightDownConnection
|
|
-----------------------------
|
|
|
|
local PitPart=Instance.new('Part')
|
|
PitPart.Transparency=1
|
|
PitPart.Size=Vector3.new(14, 0.2, 15)
|
|
	local PitDecal=Instance.new('Decal')
|
|
	PitDecal.Texture='http://www.roblox.com/asset/?id=96622746'
|
|
	PitDecal.Face='Top'
|
|
	PitDecal.Parent=PitPart
|
|
	local FallingSound = Instance.new('Sound')
|
|
	FallingSound.Volume=1
|
|
	FallingSound.SoundId='http://www.roblox.com/asset/?id=96636143'
|
|
	FallingSound.Parent=PitPart
|
|
PitPart.CanCollide=false
|
|
PitPart.Anchored=true
|
|
|
|
|
|
|
|
local MouseRightDownTime = tick()
|
|
|
|
local Swinging = false
|
|
local Bashing = false
|
|
|
|
print("Finished Loading")
|
|
|
|
function AbleToAttack()
|
|
	return MyCharacter and MyHumanoid and MyHumanoid.Health > 0
|
|
end
|
|
|
|
function TagHumanoid(humanoid, player)
|
|
	-- Add more tags here to customize what tags are available.
|
|
	while humanoid:FindFirstChild('creator') do
|
|
		humanoid:FindFirstChild('creator'):Destroy()
|
|
	end
|
|
	local creatorTag = Instance.new("ObjectValue")
|
|
	creatorTag.Value = player
|
|
	creatorTag.Name = "creator"
|
|
	creatorTag.Parent = humanoid
|
|
	DebrisService:AddItem(creatorTag, 1.5)
|
|
end
|
|
|
|
function CloneWithoutChildren(objectToClone)
|
|
	local result = objectToClone:Clone()
|
|
	for k, v in pairs(result:GetChildren()) do
|
|
		v:Destroy()
|
|
	end
|
|
	return result
|
|
end
|
|
|
|
local WeldedToArm
|
|
|
|
function CreateArmWeld()
|
|
	if ArmShieldWeld then return end
|
|
	if MyCharacter and MyCharacter:FindFirstChild('Left Arm') then
|
|
		if not WeldedToArm then
|
|
			WeldedToArm = MyCharacter:FindFirstChild('Left Arm').ChildRemoved:connect(function(child) if child.Name == 'ArmWeld' then CreateArmWeld() end end)
|
|
		end
|
|
		ArmShieldWeld = Instance.new('Weld')
|
|
		ArmShieldWeld.Name = "ArmWeld"
|
|
		ArmShieldWeld.Part0 = MyCharacter:FindFirstChild('Left Arm')
|
|
		ArmShieldWeld.Part1 = Shield
|
|
		ArmShieldWeld.C0 = CFrame.new() * CFrame.Angles(math.rad(-70), math.rad(70), 0)
|
|
		ArmShieldWeld.C1 = CFrame.new() + Vector3.new(0, 0, .6)
|
|
		ArmShieldWeld.Parent = MyCharacter:FindFirstChild('Left Arm')
|
|
|
|
	else
|
|
		print('CreateArmWeld: you have no character or no left arm.')
|
|
	end
|
|
end
|
|
|
|
function DestroyArmWeld()
|
|
	if ArmShieldWeld then
|
|
		ArmShieldWeld:Destroy()
|
|
		ArmShieldWeld = nil
|
|
	end
|
|
	if WeldedToArm then
|
|
		WeldedToArm:disconnect()
|
|
		WeldedToArm = nil
|
|
	end
|
|
end
|
|
|
|
function CreateBackWeld()
|
|
	if MyTorso and Shield then
|
|
		print("Creating BackWeld")
|
|
		BackWeld = nil
|
|
		while MyTorso:FindFirstChild("BackWeld") do
|
|
			MyTorso:FindFirstChild("BackWeld"):Destroy()
|
|
		end
|
|
		BackWeld = Instance.new('Weld')
|
|
		BackWeld.Name = "BackWeld"
|
|
		BackWeld.Part0 = MyTorso
|
|
		BackWeld.Part1 = Shield
|
|
		BackWeld.C0 = CFrame.new() * CFrame.Angles(0, math.rad(180), 0)
|
|
		BackWeld.C1 = CFrame.new() + Vector3.new(0, 0, 1.2)
|
|
		BackWeld.Parent = MyTorso
|
|
	else
|
|
		print("CreateBackWeld: Missing Torso or Shield.")
|
|
	end
|
|
end
|
|
|
|
function DestroyBackWeld()
|
|
	if BackWeld then
|
|
		print("Destroying BackWeld")
|
|
		BackWeld:Destroy()
|
|
		BackWeld = nil
|
|
	end
|
|
end
|
|
|
|
function DestroyRightGrip()
|
|
	if MyCharacter then
|
|
		local MyRightArm = MyCharacter:FindFirstChild('Right Arm')
|
|
		if MyRightArm then
|
|
			WaitForChild(MyRightArm, "RightGrip")
|
|
			RightGrip = MyRightArm:FindFirstChild('RightGrip'):Clone()
|
|
			MyRightArm:FindFirstChild('RightGrip'):Destroy()
|
|
		end
|
|
	end
|
|
end
|
|
|
|
function ResetRightGrip()
|
|
	if RightGrip and MyCharacter then
|
|
		local MyRightArm = MyCharacter:FindFirstChild('Right Arm')
|
|
		if MyRightArm then
|
|
			RightGrip.Parent = MyRightArm
|
|
		end
|
|
	end
|
|
end
|
|
|
|
local BashedPlayers = {}
|
|
|
|
function MakePit(torso)
|
|
	local dirVector=Vector3.new(torso.CFrame.p.x-script.Parent.Parent.Torso.CFrame.p.x,0,torso.CFrame.p.z-script.Parent.Parent.Torso.CFrame.p.z).unit
|
|
	PitPart.CFrame=CFrame.new(torso.CFrame.p+(dirVector*8)+Vector3.new(0,-3.3,0))
|
|
	PitPart.Parent=script.Parent
|
|
end
|
|
|
|
function SetCamera(length,pdir,target)
|
|
	local startTime=time()
|
|
	local cam= game.Workspace.CurrentCamera
|
|
	local normalDir=math.atan2(pdir.z,pdir.x)+math.pi/2
|
|
	local position=((MyTorso.CFrame.p+target)/2)+Vector3.new(math.cos(normalDir)*10,5,math.sin(normalDir)*10)
|
|
	while time()-startTime<length do
|
|
		cam.CameraType='Scriptable'
|
|
		cam.CoordinateFrame=CFrame.new(position,target)
|
|
		wait()
|
|
	end
|
|
	cam.CameraType='Custom'
|
|
end
|
|
|
|
local InTheAwesome=false
|
|
function THISISROBLOX(hit)
|
|
	if InTheAwesome then return end
|
|
	InTheAwesome=true
|
|
	if hit and hit.Parent and hit.Parent:FindFirstChild('Humanoid') and hit.Parent ~= MyCharacter then
|
|
			
|
|
			TagHumanoid(hit.Parent.Humanoid, MyPlayer)
|
|
			
|
|
			if not hit.Parent:FindFirstChild('KickedScript') then
|
|
				local inKick=true
|
|
				local LockedPos=CFrame.new(script.Parent.Parent.Torso.CFrame.p,hit.Parent.Torso.CFrame.p)
|
|
				local EnemyLockedPos=CFrame.new(hit.Parent.Torso.CFrame.p,script.Parent.Parent.Torso.CFrame.p)
|
|
				Spawn(function()
|
|
					while inKick do
|
|
						MyTorso.CFrame=LockedPos
|
|
						hit.Parent.Torso.CFrame=EnemyLockedPos
|
|
						wait()
|
|
					end
|
|
				end)
|
|
				Spawn(function() SetCamera(5,hit.Parent.Torso.CFrame.p-MyTorso.CFrame.p,hit.Parent.Torso.CFrame.p)
|
|
				end)
|
|
				MakePit(hit.Parent.Torso)
|
|
				print('Adding kicked script')
|
|
				local kicked = KickedScript:Clone()
|
|
				kicked.Parent = hit.Parent
|
|
				kicked.Disabled = false
|
|
				YellSound:Play()
|
|
				wait(2.3)
|
|
				local AnimTrack = MyHumanoid:LoadAnimation(KickAnim)
|
|
				AnimTrack:Play(.1,1,4)
|
|
				wait(1)
|
|
				--ADDFORCE
|
|
				local bashForce = Instance.new('BodyVelocity')
|
|
				bashForce.maxForce = Vector3.new(1000000, 0, 1000000)
|
|
				bashForce.velocity = (hit.Parent.Torso.CFrame.p - MyTorso.CFrame.p).unit * 40
|
|
				bashForce.Parent = hit.Parent.Torso
|
|
				--PLAY KICK SOUND
|
|
				KickSound:Play()
|
|
				Wait(.2)
|
|
				FallingSound:Play()
|
|
				inKick=false
|
|
				delay(6,function() PitPart.Parent=nil end)
|
|
				wait(2)
|
|
			end
|
|
			
|
|
		end
|
|
		InTheAwesome=false
|
|
end
|
|
|
|
function PlayAnimation(Anim, speed)
|
|
	if MyHumanoid and Anim then
|
|
		print("Playing" , Anim.Name)
|
|
		local AnimTrack = MyHumanoid:LoadAnimation(Anim)
|
|
		if speed then
|
|
			AnimTrack:AdjustSpeed(speed)
|
|
		end
|
|
		AnimTrack:Play()
|
|
		return AnimTrack
|
|
	end
|
|
	return nil
|
|
end
|
|
|
|
function ShieldBash()
|
|
	if tick() - MouseRightDownTime > 0.28 or InTheAwesome then return end
|
|
	if Bashing or UnequippedWeld or not AbleToAttack() then return end
|
|
	Bashing = true
|
|
	BashedPlayers = {}
|
|
	Sprint:Play()
|
|
	if MyTorso then
|
|
		local chargeForce = Instance.new('BodyVelocity')
|
|
		chargeForce.Name = "ChargeVelocity"
|
|
		chargeForce.maxForce = Vector3.new(1000000, 1000000, 1000000)
|
|
		chargeForce.velocity = (MyMouse.Hit.p * Vector3.new(1, 0, 1) - MyTorso.CFrame.p * Vector3.new(1,0,1)).unit * 150
|
|
		chargeForce.Parent = MyTorso
|
|
		DebrisService:AddItem(chargeForce, 0.15)
|
|
		MyTorso.CFrame = CFrame.new(MyTorso.CFrame.p, MyTorso.CFrame.p + chargeForce.velocity)
|
|
		local gyro = Instance.new('BodyGyro')
|
|
		gyro.Parent = MyTorso
|
|
		DebrisService:AddItem(gyro, 0.3)
|
|
	end
|
|
	wait(0.1)
|
|
	-- Do Animation
|
|
	PlayAnimation(ShieldBashAnim, nil)
|
|
	print("Bash!")
|
|
	BashMiss:Play()
|
|
	wait(1.2)
|
|
	Bashing = false
|
|
end
|
|
|
|
local bladeHolder
|
|
|
|
function PhaseInBlade() end
|
|
|
|
|
|
|
|
function OnEquipped(mouse)
|
|
	print('Equipped')
|
|
	MyCharacter = Tool.Parent
|
|
	MyPlayer = PlayersService.LocalPlayer
|
|
	MyHumanoid = WaitForChild(MyCharacter, 'Humanoid')
|
|
	MyTorso = WaitForChild(MyCharacter, 'Torso')
|
|
	MyMouse = mouse
|
|
	if MyMouse then
|
|
		MouseRightDownConnection = MyMouse.Button2Down:connect(function() MouseRightDownTime = tick() end)
|
|
	end
|
|
	if MyMouse then
|
|
		RightMouseConnection = MyMouse.Button2Up:connect(ShieldBash)
|
|
	end
|
|
	if Shield then
|
|
		Shield.CanCollide = false
|
|
	end
|
|
	if Handle then
|
|
		SwordBlowConnection = Handle.Touched:connect(SwordAttackBlow)
|
|
	end
|
|
	wait(0.1)
|
|
	coroutine.resume(coroutine.create(DestroyRightGrip))
|
|
	CreateBackWeld()
|
|
	if UnequippedWeldCopy then
|
|
		if UnequippedWeld then UnequippedWeld:Destroy() end
|
|
		UnequippedWeld = UnequippedWeldCopy:Clone()
|
|
		UnequippedWeld.Parent = Shield
|
|
	end
|
|
end
|
|
|
|
local shieldWalk
|
|
|
|
function OnUnequipped()
|
|
	DestroyBackWeld()
|
|
	DestroyArmWeld()
|
|
	if Shield then
|
|
		if UnEquippedWeld then UnequippedWeld:Destroy() end
|
|
		UnequippedWeld = nil
|
|
		UnequippedWeld = UnequippedWeldCopy:Clone()
|
|
		UnequippedWeld.Parent = Shield
|
|
	else
|
|
		print("Unable to recreate shield weld")
|
|
	end
|
|
	if bladeHolder then
|
|
		bladeHolder:Destroy()
|
|
		bladeHolder = nil
|
|
	end
|
|
	if Handle:FindFirstChild('Mesh') then
|
|
		Handle.Mesh.MeshId = SwordOnlyMesh
|
|
	end
|
|
	if RightMouseConnection then
|
|
		RightMouseConnection:disconnect()
|
|
		RightMouseConnection = nil
|
|
	end
|
|
	if MouseRightDownConnection then
|
|
		MouseRightDownConnection:disconnect()
|
|
		MouseRightDownConnection = nil
|
|
	end
|
|
	if ShieldBlowConnection then
|
|
		ShieldBlowConnection:disconnect()
|
|
		ShieldBlowConnection = nil
|
|
	end
|
|
	if SwordBlowConnection then
|
|
		SwordBlowConnection:disconnect()
|
|
		SwordBlowConnection = nil
|
|
	end
|
|
	if Shield then
|
|
		Shield.CanCollide = true
|
|
	end
|
|
	if RightGrip then
|
|
		RightGrip:Destroy()
|
|
		RightGrip = nil
|
|
	end
|
|
	if shieldWalk then
|
|
		print("Stopping shield walk")
|
|
		shieldWalk:Stop()
|
|
	end
|
|
end
|
|
|
|
local SlashedPlayers = {}
|
|
|
|
local HitEnabled=true
|
|
function SwordAttackBlow(hit)
|
|
	if Swinging and AbleToAttack() and HitEnabled then
|
|
		HitEnabled=false
|
|
		if hit and hit.Parent and hit.Parent:FindFirstChild('Humanoid') and hit.Parent ~= MyCharacter and not SlashedPlayers[hit.Parent] then
|
|
			SlashedPlayers[hit.Parent] = true
|
|
			TagHumanoid(hit.Parent.Humanoid, MyPlayer)
|
|
			
|
|
			if hit.Parent.Humanoid.Health<25 then
|
|
				THISISROBLOX(hit)
|
|
			else
|
|
				SwordHit:Play()
|
|
				hit.Parent.Humanoid:TakeDamage(SWORD_DAMAGE)
|
|
			end
|
|
		end
|
|
		HitEnabled=true
|
|
	end
|
|
end
|
|
|
|
|
|
function OnActivate()
|
|
	if not Tool.Enabled or InTheAwesome then return end
|
|
	Tool.Enabled=false
|
|
	print('In OnActivate')
|
|
	if Swinging or not AbleToAttack() then return end
|
|
	local dontWait = false
|
|
	if UnequippedWeld then
|
|
		dontWait = true
|
|
		shieldWalk = PlayAnimation(ShieldWalkAnim, nil)
|
|
		--wait(0.4)
|
|
		if UnequippedWeld then UnequippedWeld:Destroy() end
|
|
		UnequippedWeld = nil
|
|
		while Shield:FindFirstChild('ShieldWeld') do
|
|
			Shield:FindFirstChild('ShieldWeld'):Destroy()
|
|
		end
|
|
		SwordDraw:Play()
|
|
		if Handle:FindFirstChild('Mesh') then
|
|
			--Handle.Mesh.MeshId = CompleteMesh
|
|
		end
|
|
		DestroyBackWeld()
|
|
	else
|
|
		local AnimTrack = MyHumanoid:LoadAnimation(SlashAnim)
|
|
			AnimTrack:Play(.1,1,4)
|
|
	end
|
|
	CreateArmWeld()
|
|
	ResetRightGrip()
|
|
	SlashedPlayers = {}
|
|
	Swinging = true
|
|
	--Slash:Play()
|
|
	--PlayAnimation(SlashAnim, nil)
|
|
	if not dontWait then wait(0.8) end
|
|
|
|
	Swinging = false
|
|
	Tool.Enabled=true
|
|
end
|
|
|
|
|
|
Tool.Equipped:connect(OnEquipped)
|
|
Tool.Unequipped:connect(OnUnequipped)
|
|
Tool.Activated:connect(OnActivate)
|
|
</ProtectedString>
|
|
</Properties>
|
|
<Item class="LocalScript" referent="RBX16">
|
|
<Properties>
|
|
<bool name="Disabled">true</bool>
|
|
<Content name="LinkedSource"><null></null></Content>
|
|
<string name="Name">KickedScript</string>
|
|
<ProtectedString name="Source">local MyCharacter = script.Parent
|
|
|
|
if MyCharacter and MyCharacter:FindFirstChild('Humanoid') and MyCharacter:FindFirstChild('Torso') then
|
|
	local humanoid = MyCharacter.Humanoid
|
|
	
|
|
	MyCharacter.Torso.Anchored=true
|
|
	humanoid.Parent=nil
|
|
	for _,i in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
|
|
		i.Parent=nil
|
|
	end
|
|
	for _,i in pairs(MyCharacter:GetChildren()) do
|
|
		if i:IsA('Part') then
|
|
			i.CanCollide=false
|
|
			print('setting can collide false: ' .. i.Name)
|
|
		end
|
|
		if i:IsA('Tool') then
|
|
			i.Parent=nil
|
|
		end
|
|
	end
|
|
	
|
|
	wait(3.3)
|
|
	MyCharacter.Torso.Anchored=false
|
|
	
|
|
	--humanoid.Parent=MyCharacter
|
|
	while not script:FindFirstChild('RespawnScript') do print('WAIIIITING') wait() end
|
|
	local resScript=script:FindFirstChild('RespawnScript')
|
|
	resScript.Parent=game.Players.LocalPlayer.Backpack
|
|
	resScript.Disabled=false
|
|
end
|
|
|
|
--script:Destroy()
|
|
</ProtectedString>
|
|
</Properties>
|
|
<Item class="Script" referent="RBX17">
|
|
<Properties>
|
|
<bool name="Disabled">true</bool>
|
|
<Content name="LinkedSource"><null></null></Content>
|
|
<string name="Name">RespawnScript</string>
|
|
<ProtectedString name="Source">print('Reloading character')
|
|
wait(5)
|
|
script.Parent.Parent:LoadCharacter()
|
|
</ProtectedString>
|
|
</Properties>
|
|
</Item>
|
|
</Item>
|
|
</Item>
|
|
<Item class="Animation" referent="RBX18">
|
|
<Properties>
|
|
<Content name="AnimationId"><url>http://www.roblox.com/Asset?ID=92623582</url></Content>
|
|
<string name="Name">ShieldBashAnim</string>
|
|
</Properties>
|
|
</Item>
|
|
<Item class="Animation" referent="RBX19">
|
|
<Properties>
|
|
<Content name="AnimationId"><url>http://www.roblox.com/Asset?ID=92625513</url></Content>
|
|
<string name="Name">EquipAnim</string>
|
|
</Properties>
|
|
</Item>
|
|
<Item class="Animation" referent="RBX20">
|
|
<Properties>
|
|
<Content name="AnimationId"><url>http://www.roblox.com/Asset?ID=96677230</url></Content>
|
|
<string name="Name">QuickSlash</string>
|
|
</Properties>
|
|
</Item>
|
|
<Item class="Animation" referent="RBX21">
|
|
<Properties>
|
|
<Content name="AnimationId"><url>http://www.roblox.com/Asset?ID=49907410</url></Content>
|
|
<string name="Name">ShieldBash</string>
|
|
</Properties>
|
|
</Item>
|
|
<Item class="Animation" referent="RBX22">
|
|
<Properties>
|
|
<Content name="AnimationId"><url>http://www.roblox.com/Asset?ID=96675769</url></Content>
|
|
<string name="Name">ShieldWalk</string>
|
|
</Properties>
|
|
</Item>
|
|
<Item class="Animation" referent="RBX23">
|
|
<Properties>
|
|
<Content name="AnimationId"><url>http://www.roblox.com/Asset?ID=96621537</url></Content>
|
|
<string name="Name">Kick</string>
|
|
</Properties>
|
|
</Item>
|
|
<Item class="Camera" referent="RBX24">
|
|
<Properties>
|
|
<Ref name="CameraSubject">null</Ref>
|
|
<token name="CameraType">0</token>
|
|
<CoordinateFrame name="CoordinateFrame">
|
|
<X>-10.0124435</X>
|
|
<Y>80.8935776</Y>
|
|
<Z>-49.7428169</Z>
|
|
<R00>-0.998475432</R00>
|
|
<R01>0.00841341447</R01>
|
|
<R02>-0.0545539632</R02>
|
|
<R10>9.31322575e-010</R10>
|
|
<R11>0.98831588</R11>
|
|
<R12>0.152419895</R12>
|
|
<R20>0.055198919</R20>
|
|
<R21>0.152187526</R21>
|
|
<R22>-0.986809015</R22>
|
|
</CoordinateFrame>
|
|
<float name="FieldOfView">70</float>
|
|
<CoordinateFrame name="Focus">
|
|
<X>-9.80000019</X>
|
|
<Y>80.3000259</Y>
|
|
<Z>-45.8999977</Z>
|
|
<R00>1</R00>
|
|
<R01>0</R01>
|
|
<R02>0</R02>
|
|
<R10>0</R10>
|
|
<R11>1</R11>
|
|
<R12>0</R12>
|
|
<R20>0</R20>
|
|
<R21>0</R21>
|
|
<R22>1</R22>
|
|
</CoordinateFrame>
|
|
<string name="Name">ThumbnailCamera</string>
|
|
</Properties>
|
|
</Item>
|
|
</Item>
|
|
</roblox> |