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"))
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- Script3 = Instance.new("Script")
- Sound4 = Instance.new("Sound")
- Script5 = Instance.new("Script")
- Tool0.Name = "Gun"
- Tool0.Parent = mas
- Tool0.GripForward = Vector3.new(0.014998313, 0, -0.999887586)
- Tool0.GripPos = Vector3.new(0, 0, 1)
- Tool0.GripRight = Vector3.new(0.89165622, 0.452515543, 0.0133748427)
- Tool0.GripUp = Vector3.new(-0.45246467, 0.891756594, -0.00678696996)
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.Rotation = Vector3.new(-89.2299957, -0.389999986, -116.759995)
- Part1.RotVelocity = Vector3.new(1, 1, 1)
- Part1.Size = Vector3.new(1, 1, 5)
- Part1.CFrame = CFrame.new(-15.0473862, 6.09787512, -13.2487059, -0.450310409, 0.892846406, -0.00678965962, -0.0150141492, 3.12112206e-05, 0.999887347, 0.892745912, 0.45036158, 0.0133912731)
- Part1.Position = Vector3.new(-15.0473862, 6.09787512, -13.2487059)
- Part1.Orientation = Vector3.new(-89.1399994, -26.8899994, -89.8799973)
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "rbxassetid://625948113"
- SpecialMesh2.Scale = Vector3.new(0.300000012, 0.300000012, 0.300000012)
- SpecialMesh2.TextureId = "rbxassetid://625948238"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- SpecialMesh2.Scale = Vector3.new(0.300000012, 0.300000012, 0.300000012)
- Script3.Name = "SoundScript"
- Script3.Parent = Part1
- table.insert(cors,sandbox(Script3,function()
- --Made by BLUEHHOOD--
- while true do
- wait(0)
- script.Sound:Play(150558724)--Change this to the musicid you want. Also change the sound inside of the script.--
- wait(70)--Change this to how long you want the music to play--
- end
- end))
- Sound4.Parent = Script3
- Sound4.SoundId = "rbxassetid://180955656"
- Sound4.Looped = true
- Script5.Name = "SwordScript"
- Script5.Parent = Part1
- table.insert(cors,sandbox(Script5,function()
- --Fixed by ImGuestLie
- antiTK = true
- teamgroups = {
- --[[ HOW TO USE TEAMGROUPS:
- Put as many teams as you want in a table inside of teamgroups
- format for a teamcolor is BrickColor.new("TeamColor")
- type the EXACT teamcolor
- When a player is on a team in a teamgroup, and the person (s)he is trying to kill is also in the same teamgroup,
- the user will not get damaged.
- Basically this is like anti-TK but across multiple teams.
- --]]
- --Example of a teamgroup:
- --{ BrickColor.new("Bright red"), BrickColor.new("Bright blue") }
- }
- --END OF CONFIGURABLE OPTIONS--
- r = game:service("RunService")
- function candamage(myteam,theirteam)
- if antiTK == true and myteam == theirteam then return false end
- for i,v in pairs(teamgroups) do
- local ismyteam = false
- local istheirteam = false
- for _,v in pairs(teamgroups[i]) do
- if v == myteam then ismyteam = true end
- if v == theirteam then istheirteam = true end
- end
- if ismyteam == true and istheirteam == true then
- return false
- end
- end
- return true
- end
- local acceptableparts = {
- "Head"; "Left Arm"; "Left Leg"; "Right Arm"; "Right Leg"; "Torso";
- }
- function matches(partname)
- for i,v in pairs(acceptableparts) do
- if partname == v then
- return true
- end
- end
- return false
- end
- local damage = 5
- function blow(hit)
- if (hit.Parent == nil) then return end
- if matches(hit.Name) then
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local hum = vCharacter:findFirstChild("Humanoid")
- if humanoid and humanoid ~= hum and hum then
- -- final check, make sure sword is in-hand
- local guygettingsliced = game.Players:GetPlayerFromCharacter(hit.Parent) --OH LOOK, here's an edit
- local right_arm = vCharacter:FindFirstChild("Right Arm")
- if (right_arm) then
- local joint = right_arm:FindFirstChild("RightGrip")
- if (joint and (joint.Part0 == sword or joint.Part1 == sword)) then
- if guygettingsliced then --If he's a player
- if candamage(vPlayer.TeamColor, guygettingsliced.TeamColor) == true then
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(damage)
- wait(1)
- untagHumanoid(humanoid)
- end
- else --If he's not a player (AI, shop, etc)
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(damage)
- wait(1)
- untagHumanoid(humanoid)
- end
- end
- end
- end
- 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
- SlashSound:play()
- local anim = Instance.new("StringValue")
- anim.Name = "toolanim"
- anim.Value = "Slash"
- anim.Parent = Tool
- end
- function lunge()
- damage = lunge_damage
- LungeSound:play()
- local anim = Instance.new("StringValue")
- anim.Name = "toolanim"
- anim.Value = "Lunge"
- anim.Parent = Tool
- force = Instance.new("BodyVelocity")
- force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
- force.maxForce = Vector3.new(0,2900,0)
- force.Parent = Tool.Parent.Torso
- wait(.25)
- swordOut()
- wait(.25)
- force.Parent = nil
- wait(.5)
- swordUp()
- damage = slash_damage
- end
- function swordUp()
- Tool.GripForward = Vector3.new(-1,0,0)
- Tool.GripRight = Vector3.new(0,1,0)
- Tool.GripUp = Vector3.new(0,0,1)
- end
- function swordOut()
- Tool.GripForward = Vector3.new(0,0,1)
- Tool.GripRight = Vector3.new(0,-1,0)
- Tool.GripUp = Vector3.new(-1,0,0)
- end
- function swordAcross()
- -- parry
- end
- Tool.Enabled = true
- local last_attack = 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 < .2) then
- lunge()
- else
- attack()
- end
- last_attack = t
- --wait(.5)
- Tool.Enabled = true
- end
- script.Parent.Activated:connect(onActivated)
- script.Parent.Equipped:connect(onEquipped)
- connection = sword.Touched:connect(blow)
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = workspace
- 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