Professional Documents
Culture Documents
-----------------
--| Variables |--
-----------------
-----------------
--| Functions |--
-----------------
-- Removes any old creator tags and applies new ones to the specified target
local function ApplyTags(target)
while target:FindFirstChild('creator') do
target.creator:Destroy()
end
iconTag.Parent = creatorTag
creatorTag.Parent = target
DebrisService:AddItem(creatorTag, 4)
end
local parts = {}
for _, child in pairs(character:GetChildren()) do
if child:IsA('BasePart') then
child.Anchored = true
table.insert(parts, child)
elseif child:IsA('LocalScript') or child:IsA('Script') then
child:Destroy()
end
end
local selectionBoxes = {}
wait(0.5)
humanoid.Health = 0
DebrisService:AddItem(character, 2)
FireSound:Play()
ReloadSound:Play()
wait(0) -- ReloadSound length
Tool.Enabled = true
end
end
end
--------------------
--| Script Logic |--
--------------------
BaseShot = Instance.new('Part')
BaseShot.Name = 'Effect'
BaseShot.FormFactor = Enum.FormFactor.Custom
BaseShot.Size = Vector3.new(0.2, 0.2, 3)
BaseShot.CanCollide = false
BaseShot.BrickColor = BrickColor.new('Really red')
SelectionBoxify(BaseShot)
Light(BaseShot)
HitFadeSound:Clone().Parent = BaseShot
Tool.Equipped:connect(OnEquipped)
Tool.Unequipped:connect(OnUnequipped)
Tool.Activated:connect(OnActivated)
end,o8)
end))
o9.Name = "HitFade"
o9.Parent = o8
o9.SoundId = "http://www.roblox.com/asset?id=130113415"
o10.Name = "MouseIcon"
o10.Parent = o1
table.insert(cors,coroutine.create(function()
wait()
runDummyScript(function()
local MOUSE_ICON = 'rbxasset://textures/GunCursor.png'
local RELOADING_ICON = 'rbxasset://textures/GunWaitCursor.png'
Tool.Equipped:connect(OnEquipped)
Tool.Changed:connect(OnChanged)
end,o10)
end))
o11.Name = "Shu_hold"
o11.Parent = o1
table.insert(cors,coroutine.create(function()
wait()
runDummyScript(function()
--This script gives you a next-gen hold script better than the current one. You
actually hold the barrel parallel to your face. Put it in any gun you want.
Original script by Xliver101, Converted to universal script by ToastyToaster.
selected = false
RSH, LSH = nil, nil
GRP = nil
RW, LW = Instance.new("Weld"), Instance.new("Weld")
anim = "none"
function WaitForChild(obj, ch_n)
local t = time()
while not obj:FindFirstChild(ch_n) and time() - t < 10 do wait(0.1) end
return obj:FindFirstChild(ch_n)
end
script.Parent.Equipped:connect(function()
if selected then return end
selected = true
player = game.Players:playerFromCharacter(script.Parent.Parent)
local ch = script.Parent.Parent
WaitForChild(ch, "Torso")
RSH = WaitForChild(ch.Torso, "Right Shoulder")
LSH = WaitForChild(ch.Torso, "Left Shoulder")
GRP = WaitForChild(ch["Right Arm"], "RightGrip")
_G.Grip = GRP
--
RSH.Part1 = nil
LSH.Part1 = nil
--
RW.Part0 = ch.Torso
RW.C0 = CFrame.new(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
RW.C1 = CFrame.new(0, 0.5, 0)
RW.Part1 = ch["Right Arm"]
RW.Parent = ch.Torso
_G.R = RW
--
LW.Part0 = ch.Torso
LW.C0 = CFrame.new(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
LW.C1 = CFrame.new(0, 0.5, 0)
LW.Part1 = ch["Left Arm"]
LW.Parent = ch.Torso
_G.L = LW
--
GRP.C0 = CFrame.new(0, -1, -0.5) * CFrame.fromEulerAnglesXYZ(-1.22, -0.45,
0.22)
for i = 0, 1, 0.05 do
wait()
RW.C0 = CFrame.new(1.5, 0.5, 0.25) * CFrame.fromEulerAnglesXYZ(1.3*i,
0, -0.5*i)
LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.7*i, 0,
0.8*i)
LW.C1 = CFrame.new(0.3*i, 1+1*i, 0)
end
wait()
local rg = (ch["Right Arm"]:FindFirstChild("RightGrip") or GRP)
if rg ~= GRP then
GRP.Parent = ch["Right Arm"]
rg:remove()
end
end)
script.Parent.Unequipped:connect(function()
selected = false
local pl = player
RW.C0 = CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
LW.C0 = CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
LW.C1 = CFrame.new(0,0,0)
RW.Parent = nil
LW.Parent = nil
RSH.Part1 = pl.Character["Right Arm"]
LSH.Part1 = pl.Character["Left Arm"]
end)
function armReload()
for i = 0, 1, 0.1 do
wait()
LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.3*i, 0,
0.9*i)
LW.C1 = CFrame.new(0.3*i, 1+1*i, 0)
end
end
function gunOut()
for i = 0, 0.3, 0.06 do
wait()
GRP.C0 = CFrame.new(0+i, -1-i, 0+(2*i)) * CFrame.fromEulerAnglesXYZ(-
2.22, -0.45, 0.42)
LW.C0 = CFrame.new(-1, 0.5, 0) * CFrame.fromEulerAnglesXYZ(4.2, 0, 2.9)