Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Replicated = game:GetService("ReplicatedStorage")
- game.StarterPlayer.EnableMouseLockOption = false
- local Debounce = false
- Replicated.Remotes.APRemote.OnServerInvoke = function(Player)
- if Debounce == false then
- Debounce = true
- local Char = Player.Character
- local function onTouched()
- if Char:findFirstChild("Humanoid") ~= nil and Char:findFirstChild("Chest") == nil then
- local APModel = game.ReplicatedStorage.Equipment.APModel
- local g = APModel.Chest:clone()
- g.Parent = Char
- local C = g:GetChildren()
- g.Middle.Transparency = 1
- for i=1, #C do
- if C[i].className == "Part" or C[i].className == "WedgePart" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" then
- local W = Instance.new("Weld")
- W.Part0 = g.Middle
- W.Part1 = C[i]
- local CJ = CFrame.new(g.Middle.Position)
- local C0 = g.Middle.CFrame:inverse()*CJ
- local C1 = C[i].CFrame:inverse()*CJ
- W.C0 = C0
- W.C1 = C1
- W.Parent = g.Middle
- end
- local Y = Instance.new("Weld")
- Y.Part0 = Char.Torso
- Y.Part1 = g.Middle
- Y.C0 = CFrame.new(0, 0, 0)
- Y.Parent = Y.Part0
- end
- local h = g:GetChildren()
- for i = 1, # h do
- h[i].Anchored = false
- h[i].CanCollide = false
- end
- end
- -----------------------------------------------------------------------------------------------------------------------------------------
- if Char:findFirstChild("Humanoid") ~= nil and Char:findFirstChild("RightGun") == nil then
- local APModel = game.ReplicatedStorage.Equipment.APModel
- local RightArm = Char["Right Arm"]
- local g = APModel.RightGun:clone()
- g.Parent = Char
- local C = g:GetChildren()
- g.Middle.Transparency = 1
- for i=1, #C do
- if C[i].className == "Part" or C[i].className == "WedgePart" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" then
- local W = Instance.new("Weld")
- W.Part0 = g.Middle
- W.Part1 = C[i]
- local CJ = CFrame.new(g.Middle.Position)
- local C0 = g.Middle.CFrame:inverse()*CJ
- local C1 = C[i].CFrame:inverse()*CJ
- W.C0 = C0
- W.C1 = C1
- W.Parent = g.Middle
- end
- local Y = Instance.new("Weld")
- Y.Part0 = Char["Right Arm"]
- Y.Part1 = g.Middle
- Y.C0 = CFrame.new(0, 0, 0)
- Y.Parent = Y.Part0
- end
- local h = g:GetChildren()
- for i = 1, # h do
- h[i].Anchored = false
- h[i].CanCollide = false
- end
- end
- -----------------------------------------------------------------------------------------------------------------------------------------
- if Char:findFirstChild("Humanoid") ~= nil and Char:findFirstChild("LeftGun") == nil then
- local APModel = game.ReplicatedStorage.Equipment.APModel
- local RightArm = Char["Left Arm"]
- local g = APModel.LeftGun:clone()
- g.Parent = Char
- local C = g:GetChildren()
- g.Middle.Transparency = 1
- for i=1, #C do
- if C[i].className == "Part" or C[i].className == "WedgePart" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" then
- local W = Instance.new("Weld")
- W.Part0 = g.Middle
- W.Part1 = C[i]
- local CJ = CFrame.new(g.Middle.Position)
- local C0 = g.Middle.CFrame:inverse()*CJ
- local C1 = C[i].CFrame:inverse()*CJ
- W.C0 = C0
- W.C1 = C1
- W.Parent = g.Middle
- end
- local Y = Instance.new("Weld")
- Y.Part0 = Char["Left Arm"]
- Y.Part1 = g.Middle
- Y.C0 = CFrame.new(0, 0, 0)
- Y.Parent = Y.Part0
- end
- local h = g:GetChildren()
- for i = 1, # h do
- h[i].Anchored = false
- h[i].CanCollide = false
- end
- end
- -----------------------------------------------------------------------------------------
- if Char:findFirstChild("Humanoid") ~= nil and Char:findFirstChild("LeftAmmo") == nil then
- local APModel = game.ReplicatedStorage.Equipment.APModel
- local RightArm = Char["Left Leg"]
- local g = APModel.LeftAmmo:clone()
- g.Parent = Char
- local C = g:GetChildren()
- g.Middle.Transparency = 1
- for i=1, #C do
- if C[i].className == "Part" or C[i].className == "WedgePart" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" then
- local W = Instance.new("Weld")
- W.Part0 = g.Middle
- W.Part1 = C[i]
- local CJ = CFrame.new(g.Middle.Position)
- local C0 = g.Middle.CFrame:inverse()*CJ
- local C1 = C[i].CFrame:inverse()*CJ
- W.C0 = C0
- W.C1 = C1
- W.Parent = g.Middle
- end
- local Y = Instance.new("Weld")
- Y.Part0 = Char["Left Leg"]
- Y.Part1 = g.Middle
- Y.C0 = CFrame.new(0, 0, 0)
- Y.Parent = Y.Part0
- end
- local h = g:GetChildren()
- for i = 1, # h do
- h[i].Anchored = false
- h[i].CanCollide = false
- end
- end
- -----------------------------------------------------------------------------------------
- if Char:findFirstChild("Humanoid") ~= nil and Char:findFirstChild("RightAmmo") == nil then
- local APModel = game.ReplicatedStorage.Equipment.APModel
- local RightArm = Char["Right Leg"]
- local g = APModel.RightAmmo:clone()
- g.Parent = Char
- local C = g:GetChildren()
- g.Middle.Transparency = 1
- for i=1, #C do
- if C[i].className == "Part" or C[i].className == "WedgePart" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" then
- local W = Instance.new("Weld")
- W.Part0 = g.Middle
- W.Part1 = C[i]
- local CJ = CFrame.new(g.Middle.Position)
- local C0 = g.Middle.CFrame:inverse()*CJ
- local C1 = C[i].CFrame:inverse()*CJ
- W.C0 = C0
- W.C1 = C1
- W.Parent = g.Middle
- end
- local Y = Instance.new("Weld")
- Y.Part0 = Char["Right Leg"]
- Y.Part1 = g.Middle
- Y.C0 = CFrame.new(0, 0, 0)
- Y.Parent = Y.Part0
- end
- local h = g:GetChildren()
- for i = 1, # h do
- h[i].Anchored = false
- h[i].CanCollide = false
- end
- Char.Animate.idle.Animation1.AnimationId = "rbxassetid://04187286257"
- Char.Animate.idle.Animation2.AnimationId = "rbxassetid://04187286257"
- Char.Animate.walk.WalkAnim.AnimationId = "rbxassetid://4359115738"
- Char.Animate.Disabled = true
- wait(0.1)
- Char.Animate.Disabled = false
- end
- end
- onTouched()
- Replicated.Equipment.APModel.APScript:Clone().Parent = Player.Backpack
- Replicated.Equipment.APModel.SprintScript:Clone().Parent = Player.Backpack
- --//UnEquip\\--
- elseif Debounce == true then
- Debounce = false
- local Char = Player.Character
- Char:FindFirstChild("RightAmmo"):Destroy()
- Char:FindFirstChild("LeftAmmo"):Destroy()
- Char:FindFirstChild("RightGun"):Destroy()
- Char:FindFirstChild("LeftGun"):Destroy()
- Char:FindFirstChild("Chest"):Destroy()
- Player.Backpack:FindFirstChild("APScript"):Destroy()
- Player.Backpack:FindFirstChild("SprintScript"):Destroy()
- if Char:findFirstChild("Humanoid") ~= nil and Char:findFirstChild("Right Grapple") then
- Char:FindFirstChild("Right Grapple"):Destroy()
- end
- for i,v in pairs(Char:GetChildren()) do
- if v:IsA("BoolValue") then
- if v.Name == "Right Grapple" or v.Name == "Left Grapple" then
- v:Destroy()
- end
- end
- end
- Char.Animate.idle.Animation1.AnimationId = "rbxassetid://180435571"
- Char.Animate.idle.Animation2.AnimationId = "rbxassetid://180435792"
- Char.Animate.walk.WalkAnim.AnimationId = "rbxassetid://180426354"
- Char.Animate.Disabled = true
- wait(0.1)
- Char.Animate.Disabled = false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement