Professional Documents
Culture Documents
Name = "PaperCut"
Player = game:GetService("Players").LocalPlayer
Char = Player.Character
animate = Char:findFirstChild("Animate")
if animate then
animate:Destroy()
end
Name = "PaperCut"
selected = false
Button1Down = false
damage = 3
canUse = true
swordType = "normal"
swordType2 = "normal"
function makeParts(format)
local model = Instance.new("Model")
model.Name = Name
model.Parent = Player.Character
local pm2 = Instance.new("Part")
pm2.Material = "SmoothPlastic"
pm2.Name = "Weld Point"
pm2.formFactor = "Symmetric"
pm2.Size = Vector3.new(1, 1, 1)
pm2.BrickColor = BrickColor.new("Really black")
pm2.Transparency = 1
pm2.Locked = true
pm2.CanCollide = false
pm2.TopSurface = 0
pm2.BottomSurface = 0
pm2.Parent = model
if format ~= nil then
local w = Instance.new("Weld")
w.Part0 = pm2
if format == "hand" then
w.Part1 = Player.Character:FindFirstChild("Right Arm")
w.C0 = CFrame.new(0, 1.1, 0.7)
w.C1 = CFrame.new()
w.Parent = pm2
elseif format == "holster" then
w.Part1 = Player.Character:FindFirstChild("Torso")
w.C0 = CFrame.new(0.6, -0.5, 0) *
CFrame.fromEulerAnglesXYZ(math.rad(90), math.rad(90), 0)
w.C1 = CFrame.new()
w.Parent = pm2
model.Name = Name.. " (Holstered)"
else
print("Error: Incorrect format string!")
end
end
local pm = Instance.new("Part")
pm.Material = "SmoothPlastic"
pm.Name = "Handle"
pm.formFactor = "Symmetric"
pm.Size = Vector3.new(1, 1, 1)
pm.BrickColor = BrickColor.new("Really black")
pm.Locked = true
pm.CanCollide = false
pm.TopSurface = 0
pm.BottomSurface = 0
pm.Parent = model
local m = Instance.new("SpecialMesh")
m.MeshType = "Brick"
m.Scale = Vector3.new(0.3, 0.5, 0.1)
m.Parent = pm
local w = Instance.new("Weld")
w.Part0 = pm
w.Part1 = pm2
w.C0 = CFrame.new()
w.C1 = CFrame.new()
w.Parent = pm
local s = Instance.new("Sound")
s.Name = "Slash"
s.SoundId = "rbxasset://sounds/swordslash.wav"
s.Volume = 1
s.Pitch = 2
s.Looped = false
s.Parent = pm
local s = Instance.new("Sound")
s.Name = "Throw"
s.SoundId = "http://www.roblox.com/asset/?id=18426149"
s.Volume = 1
s.Pitch = 1
s.Looped = false
s.Parent = pm
local s = Instance.new("Sound")
s.Name = "Impact"
s.SoundId = "http://www.roblox.com/asset/?id=10209596"
s.Volume = 1
s.Pitch = 1
s.Looped = false
s.Parent = pm
local s = Instance.new("Sound")
s.Name = "Tick"
s.SoundId = "http://www.roblox.com/asset/?id=15666462"
s.Volume = 1
s.Pitch = 0.5
s.Looped = false
s.Parent = pm
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Grip"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = BrickColor.new("Really black")
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("SpecialMesh")
m.MeshType = "Brick"
m.Scale = Vector3.new(0.25, 0.4, 0.9)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 0, -0.5)
w.C1 = CFrame.new()
w.Parent = p
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Blade"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = BrickColor.new("Silver")
p.Reflectance = 0.2
p.Locked = true
p.CanCollide = false
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("BlockMesh")
m.Scale = Vector3.new(0.01, 0.3, 0.85)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 0, 0.4)
w.C1 = CFrame.new()
w.Parent = p
p.Touched:connect(function(hit) onTouched(hit, p, "sword") end)
local p = Instance.new("Part")
p.Material = "SmoothPlastic"
p.Name = "Blade Tip"
p.formFactor = "Symmetric"
p.Size = Vector3.new(1, 1, 1)
p.BrickColor = BrickColor.new("Silver")
p.Reflectance = 0.2
p.CanCollide = false
p.Locked = true
p.TopSurface = 0
p.BottomSurface = 0
p.Parent = model
local m = Instance.new("SpecialMesh")
m.MeshType = "Wedge"
m.Scale = Vector3.new(0.01, 0.3, 0.35)
m.Parent = p
local w = Instance.new("Weld")
w.Part0 = p
w.Part1 = pm
w.C0 = CFrame.new(0, 0, 1) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(180))
w.C1 = CFrame.new()
w.Parent = p
p.Touched:connect(function(hit) onTouched(hit, p, "sword") end)
end
function removeParts(format)
if format == "hand" then
if Player.Character:FindFirstChild(Name) ~= nil then
Player.Character[Name]:Remove()
end
elseif format == "holster" then
if Player.Character:FindFirstChild(Name.. " (Holstered)") ~= nil then
Player.Character[Name.. " (Holstered)"]:Remove()
end
end
end
function Weld(x, y)
local weld = Instance.new("Weld")
weld.Part0 = x
weld.Part1 = y
CJ = CFrame.new(x.Position)
C0 = x.CFrame:inverse() * CJ
C1 = y.CFrame:inverse() * CJ
weld.C0 = C0
weld.C1 = C1
weld.Parent = x
end
function tagHumanoid(humanoid)
local tag = Instance.new("ObjectValue")
tag.Name = "creator"
tag.Value = Player
tag.Parent = humanoid
local tag = Instance.new("StringValue")
tag.Name = "creatorType1"
tag.Value = Name
tag.Parent = humanoid
local tag = Instance.new("StringValue")
tag.Name = "creatorType2"
tag.Value = "stabbed"
tag.Parent = humanoid
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:FindFirstChild("creator")
if tag ~= nil then
tag:Remove()
end
local tag = humanoid:FindFirstChild("creatorType1")
if tag ~= nil then
tag:Remove()
end
local tag = humanoid:FindFirstChild("creatorType2")
if tag ~= nil then
tag:Remove()
end
end
end
function onButton1Down(mouse)
if selected == false then return end
if Player.Character:FindFirstChild(Name) ~= nil and Button1Down == false and
canUse == true then
if Player.Character[Name]:FindFirstChild("Handle") == nil then return
end
mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
playAnimation("slashStart")
Button1Down = true
end
end
function onButton1Up(mouse)
if selected == false or Button1Down == false then return end
Button1Down = false
if canUse == false then return end
canUse = false
coroutine.resume(coroutine.create(function()
for i = 1, 2 do
if Player.Character:FindFirstChild(Name) == nil then break end
if Player.Character[Name]:FindFirstChild("Blade") ~= nil then
local part = Player.Character[Name].Blade:Clone()
part.Anchored = true
part.CanCollide = false
part.Parent = game:GetService("Workspace")
coroutine.resume(coroutine.create(function(part2) for i =
0, 1, 0.1 do part2.Transparency = i wait() end part2:Remove() end), part)
end
if Player.Character[Name]:FindFirstChild("Blade Tip") ~= nil then
local part = Player.Character[Name]["Blade Tip"]:Clone()
part.Anchored = true
part.CanCollide = false
part.Parent = game:GetService("Workspace")
coroutine.resume(coroutine.create(function(part2) for i =
0, 1, 0.1 do part2.Transparency = i wait() end part2:Remove() end), part)
end
wait()
end
end))
if swordType2 == "normal" then
swordType = "slash"
playAnimation("slashEnd1")
wait(0.1)
elseif swordType2 == "stab" then
swordType = "stab"
playAnimation("slashEnd2")
wait(1)
end
canUse = true
swordType = "normal"
mouse.Icon = "rbxasset://textures\\GunCursor.png"
end
function onSelected(mouse)
if selected == true then return end
selected = true
mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
if Player.Character.WeaponActivated.Value == nil then break end
if Player.Character.WeaponActivated.Value.Parent == nil then break end
wait()
end
mouse.Icon = "rbxasset://textures\\GunCursor.png"
local weapon = Instance.new("ObjectValue")
weapon.Name = "WeaponActivated"
weapon.Value = script.Parent
weapon.Parent = Player.Character
DisableLimb(1, Player.Character)
removeParts("holster")
makeParts("hand")
playAnimation("normal")
if swordType2 == "normal" then playAnimation("equip1") elseif swordType2 ==
"stab" then playAnimation("equip2") end
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
mouse.Button1Up:connect(function() onButton1Up(mouse) end)
mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
end
function onDeselected(mouse)
if selected == false then return end
Button1Down = false
onButton1Up(nil)
selected = false
while canUse == false do
wait()
end
while canUse == false do
wait()
end
if Player.Character:FindFirstChild("WeaponActivated") ~= nil then
if Player.Character.WeaponActivated.Value == script.Parent then
Player.Character.WeaponActivated:Remove()
end
end
while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
if Player.Character.WeaponActivated.Value == nil then break end
if pcall(function() if Player.Character.WeaponActivated.Value.Parent ==
nil then return true end end) then break end
wait()
end
swordType = "normal"
EnableLimb(1, Player.Character)
removeParts("hand")
makeParts("holster")
end