|
| 13 Aug 2013 01:15 PM |
Since everybody was discouraged by how big the script was, ima revise the problem.
I have a script, and it works in everything but Online mode. It used to work, but then I put these inside the script:
Variable: stenanimate = script.StenAnimate:Clone() Inside Equipped function: stenanim.Parent = character stenanim.Disabled = false Inside Unequipped function: stenanim.Parent = nil
StenAnimate IS inside the script (Basically Animate with RShoulder and LShoulder taken out).
Here is the full script, if you need StenAnimate just ask:
s = script.Parent ammo = script.Parent.AmmoGui:Clone() stenanim = script.StenAnimate:Clone() player = game.Players.LocalPlayer character = player.Character rs = character.Torso["Right Shoulder"] ls = character.Torso["Left Shoulder"] rh = character.Torso["Right Hip"] lh = character.Torso["Left Hip"] reload = false isready = false currentcamera = Workspace.CurrentCamera q = false e = false
s.Equipped:connect(function(mouse) wait(0.01) for i, v in ipairs(s.Handle:GetChildren()) do if v:IsA("Weld") then v:Destroy() end end for i, v in ipairs(s.Clip1:GetChildren()) do if v:IsA("Weld") then v:Destroy() end end for i, v in ipairs(character.Torso:GetChildren()) do if v:IsA("Motor6D") then v.MaxVelocity = 0.3 end end if character:FindFirstChild("Animate") then character.Animate.Disabled = true end function weld(part0,part1,c0) local weld = Instance.new("Weld",part0) for n,o in pairs({C0=c0,Part0=part0,Part1=part1})do weld[n] = o end return weld end rarm = character["Right Arm"]:Clone() larm = character["Left Arm"]:Clone() h = s.Handle weld(h,s.BackSight1,CFrame.new(0.06,0.47,-0.7)) weld(h,s.BackSight2,CFrame.new(-0.06,0.47,-0.7)) weld(h,s.BackSightDecoration1,CFrame.new(0.06, 0.54, -0.7)) weld(h,s.BackSightDecoration2,CFrame.new(-0.06, 0.54, -0.7)) weld(h,s.BarrelHole,CFrame.new(0, 0.3, 1.53)*CFrame.Angles(math.rad(90),0,0)) weld(h,s.Body,CFrame.new(0,0.3,0.37)*CFrame.Angles(math.rad(90),0,0)) clip = weld(h,s.Clip1,CFrame.new(0.33,0.3,0.32)) -- Clip variable weld(s.Clip1,s.Clip2,CFrame.new(0.154,0,0.008)*CFrame.Angles(0,math.rad(-11),0)) weld(s.Clip1,s.Clip3,CFrame.new(0.379,0,0.064)*CFrame.Angles(0,math.rad(-15),0)) weld(h,s.ClipHold,CFrame.new(0.27,0.3,0.32)) weld(h,s.ClipHole,CFrame.new(0.3,0.3,0.32)) weld(h,s.FakeHandle,CFrame.new(0,0,0)*CFrame.Angles(math.rad(20),0,0)) weld(h,s.FakeLight,CFrame.new(0,0.08,1.51)*CFrame.Angles(math.rad(90),0,0)) weld(h,s.FrontSight,CFrame.new(0,0.49,1.55)) weld(h,s.HandleDecoration1,CFrame.new(0,-0.188,-0.068)*CFrame.Angles(math.rad(20),0,0)) weld(h,s.HandleDecoration2,CFrame.new(0, -0.094, -0.034)*CFrame.Angles(math.rad(20),0,0)) weld(h,s.HandleDecoration3,CFrame.new(0,0,0)*CFrame.Angles(math.rad(20),0,0)) weld(h,s.Light,CFrame.new(0,0.08,1.51)*CFrame.Angles(math.rad(-180),0,0)) weld(h,s.Lighthold,CFrame.new(0,0.09,1.45)) weld(h,s.Stock1,CFrame.new(0,0.31,-1.24)) weld(h,s.Stock2,CFrame.new(0,0.14,-1.44)) weld(h,s.StockHold1,CFrame.new(0.19,0.31,-0.93)) weld(h,s.StockHold2,CFrame.new(-0.19,0.31,-0.93)) weld(h,s.StockHold3,CFrame.new(0,0.31,-1.04)) weld(h,s.StockHold4,CFrame.new(-0.149, 0.31, -0.754)*CFrame.Angles(0,math.rad(39),0)) weld(h,s.StockHold5,CFrame.new(0.153, 0.31, -0.758)*CFrame.Angles(0,math.rad(-39),0)) weld(h,s.Trigger,CFrame.new(0,0.11,0.258)*CFrame.Angles(math.rad(-9),0,0)) weld(h,s.Triggercover,CFrame.new(0,0.1,0.4)) weld(h,s.TriggercoverBottom,CFrame.new(0,0.01,0.27)) rarm.Parent = script.Parent larm.Parent = script.Parent rarm.Transparency = 0.3 larm.Transparency = 0.3 rarm.CanCollide = false larm.CanCollide = false rarm.Name = "FakeRight" larm.Name = "FakeLeft" weld(character["Right Arm"],rarm,CFrame.new(0,0,0)) weld(character["Left Arm"],larm,CFrame.new(0,0,0)) ammo.Parent = game.Players.LocalPlayer.PlayerGui wait() ls:SetDesiredAngle(math.rad(-90)) lh:SetDesiredAngle(0) rh:SetDesiredAngle(0) rs:SetDesiredAngle(math.rad(90)) rs.C0 = CFrame.new(0.6,0.4,rs.C0.Z)*CFrame.Angles(0,math.rad(105),0) ls.C0 = CFrame.new(-0.2, 0.6, -0.5)*CFrame.Angles(0,math.rad(-100),0) character["Right Arm"].Transparency = 1 character["Left Arm"].Transparency = 1 stenanim.Disabled = false stenanim.Parent = character mouse.Icon = "rbxasset://textures\\GunCursor.png" isready = true bdown = false mouse.Button1Down:connect(function() if isready == true then damage = true function GetBullet(hit) local ignore = character:GetChildren() for i, v in ipairs(hit.Parent:GetChildren()) do for i = 1, #ignore do if ignore[i] == hit then damage = false end end if v:IsA("Humanoid") and damage == true then v:TakeDamage(math.random(3,7)) end end end bdown = true while bdown and wait(0.15) and script.Parent.Ammo.Value > 0 and reload == false do local mH = mouse.Hit local pa = Instance.new("Part",Workspace) local v = Instance.new("BodyVelocity",pa) local sound = Instance.new("Sound",script.Parent.Handle) local sw = coroutine.wrap(function()repeat wait() until sound.IsPlaying == false sound:Destroy() end) local w = coroutine.wrap(function() wait(5) if pa ~= nil then pa:Destroy() end end) local cc = coroutine.wrap(function() currentcamera.Focus = CFrame.new(currentcamera.Focus.X+0.015,currentcamera.Focus.Y+0.025,currentcamera.Focus.Z) wait(0.05) currentcamera.Focus = CFrame.new(currentcamera.Focus.X-0.01,currentcamera.Focus.Y-0.02,currentcamera.Focus.Z) end) script.Parent.Ammo.Value = script.Parent.Ammo.Value - 1 pa.FormFactor = 3 pa.Size = Vector3.new(.2,.2,.2) pa.BrickColor = BrickColor.DarkGray() pa.CFrame = script.Parent.Handle.CFrame * CFrame.new(script.Parent.Parent.Torso.CFrame.lookVector * 2) pa.CFrame = CFrame.new(pa.Position, mH.p) v.maxForce = Vector3.new(10000,10000,10000) v.P = 6000 v.velocity = pa.CFrame.lookVector * 120 pa.Touched:connect(GetBullet) sound.SoundId = "http://www.roblox.com/asset/?id=13510352" sound.Pitch = 1 sound.Volume = 1 sound:Play() cc() w() sw() end end end)
mouse.Button1Up:connect(function() bdown = false end)
mouse.KeyDown:connect(function(key) if key == "r" and bdown == false and reload == false and s.Ammo.Value ~= s.MaxAmmo.Value and isready == true then reload = true local sound = Instance.new("Sound",script.Parent.Handle) sound.SoundId = "http://www.roblox.com/asset/?id=2697432" sound.Volume = 1 sound:Play() for i = 1, 8 do wait(0.05) clip.C0 = CFrame.new(clip.C0.X+0.1,clip.C0.Y,clip.C0.Z) ls.C0 = CFrame.new(ls.C0.X-0.1,ls.C0.Y,ls.C0.Z)*CFrame.Angles(0,math.rad(-100),0) end s.Clip1.Transparency = 1 s.Clip2.Transparency = 1 s.Clip3.Transparency = 1 ls:SetDesiredAngle(math.rad(-15)) wait(0.38) ls:SetDesiredAngle(math.rad(-90)) wait(0.4) s.Clip1.Transparency = 0 s.Clip2.Transparency = 0 s.Clip3.Transparency = 0 for i = 1, 8 do wait(0.05) clip.C0 = CFrame.new(clip.C0.X-0.1,clip.C0.Y,clip.C0.Z) ls.C0 = CFrame.new(ls.C0.X+0.1,ls.C0.Y,ls.C0.Z)*CFrame.Angles(0,math.rad(-100),0) end script.Parent.Ammo.Value = script.Parent.MaxAmmo.Value sound:Destroy() reload = false elseif key == "f" and reload == false and bdown == false then if s.Light.SpotLight.Enabled == false and reload == false and bdown == false then ls.C0 = CFrame.new(ls.C0.X,ls.C0.Y,ls.C0.Z-0.5)*CFrame.Angles(0,math.rad(-100),0) s.Light.SpotLight.Enabled = true wait(0.1) ls.C0 = CFrame.new(ls.C0.X,ls.C0.Y,ls.C0.Z+0.5)*CFrame.Angles(0,math.rad(-100),0) elseif s.Light.SpotLight.Enabled == true and reload == false and bdown == false then ls.C0 = CFrame.new(ls.C0.X,ls.C0.Y,ls.C0.Z-0.5)*CFrame.Angles(0,math.rad(-100),0) s.Light.SpotLight.Enabled = false wait(0.1) ls.C0 = CFrame.new(ls.C0.X,ls.C0.Y,ls.C0.Z+0.5)*CFrame.Angles(0,math.rad(-100),0) end elseif key == "q" then q = true if rarm.Transparency < 0.8 and larm.Transparency < 0.8 then rarm.Transparency = rarm.Transparency + 0.05 larm.Transparency = larm.Transparency + 0.05 wait(0.3) if q == true then repeat wait(0.1) if q == true and rarm.Transparency < 0.7 and larm.Transparency < 0.7 then rarm.Transparency = rarm.Transparency + 0.05 larm.Transparency = larm.Transparency + 0.05 end until q == false end elseif rarm.Transparency == 1 and larm.Transparency == 1 then character["Right Arm"].Transparency = 0 character["Left Arm"].Transparency = 0 end elseif key == "e" then e = true if rarm.Transparency ~= 0 and larm.Transparency ~= 0 then rarm.Transparency = rarm.Transparency - 0.05 larm.Transparency = larm.Transparency - 0.05 wait(0.3) if e == true then repeat wait(0.1) if e == true and rarm.Transparency > 0 and larm.Transparency > 0 then rarm.Transparency = rarm.Transparency - 0.05 larm.Transparency = larm.Transparency - 0.05 end until e == false end elseif rarm.Transparency == 0 and larm.Transparency == 0 then character["Right Arm"].Transparency = 1 character["Left Arm"].Transparency = 1 end end end) mouse.KeyUp:connect(function(key) if key == "q" and isready == true then q = false elseif key == "e" and isready == true then e = false end end) end)
s.Unequipped:connect(function() function clear(parent,object) for i, v in ipairs(parent:GetChildren()) do if v:IsA(object) then v:Destroy() end end end character.Animate.Disabled = false for i, v in ipairs(character.Torso:GetChildren()) do if v:IsA("Motor6D") then v.MaxVelocity = 0.1 end end if script.Parent.Parent ~= Workspace then clear(s.Handle,"Weld") clear(s.Clip1,"Weld") clear(character["Right Arm"],"Weld") clear(character["Left Arm"],"Weld") rarm:Destroy() larm:Destroy() character["Right Arm"].Transparency = 0 character["Left Arm"].Transparency = 0 end clear(s.Handle,"Sound") ammo.Parent = nil ls.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) rs.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) stenanim.Parent = nil isready = false end)
s.Ammo.Changed:connect(function() ammo.Ammo.Text = tostring(s.Ammo.Value).."/"..tostring(s.MaxAmmo.Value) end)
|
|
|
| Report Abuse |
|