Vicctus
|
  |
| Joined: 05 Sep 2013 |
| Total Posts: 589 |
|
|
| 09 Jun 2014 04:03 PM |
-- general stats -- _G.GunName="Officer's Pistol" _G.GunDesc="" _G.Tool=script.Parent _G.Teamkill = true _G.Handle=script.Parent["Handle"] _G.SoundBase=0.9 _G.SoundDivider=1.7 _G.Flash = script.Parent:FindFirstChild("Barrel") _G.WeldRightArm=CFrame.new(-1,.4,0.4)*CFrame.Angles(math.rad(270),math.rad(-5),0) _G.WeldLeftArm=CFrame.new(0.8,0.5,0.4)*CFrame.Angles(math.rad(280),math.rad(40),0) _G.Stats={ ["maxaccuracy"]=0.06; ["minaccuracy"]=0.02; ["animationtype"]="Pistol"; ["firerate"]=0.1; ["aimflaw"]=2; ["reposition"]=33; ["focuscamera"]=60; ["firepos"]=Vector3.new(0,0.55,-1.3); ["firemode"]="Semi"; ["reloading"]=false; } _G.Origin=script.Parent _G.Values={ ["canfire"]=script.CanFire; ["ammo"]=script.Ammo; ["ammomax"]=script.AmmoMax; ["recoil"]=script.Recoil; } _G.DMG=(function(range) damage=12 return damage end)
-- parts -- _G.bullet=Instance.new("Part") _G.bullet.Anchored=true _G.bullet.CanCollide=false _G.bullet.formFactor="Custom" _G.bullet.Name = "Bullet" _G.bullet.Size=Vector3.new(1,1,1) _G.bullet.BrickColor=BrickColor.new("Bright yellow") _G.bullet.Reflectance=0.01 mesh=Instance.new("BlockMesh", _G.bullet) mesh.Scale=Vector3.new(0.1,0.1,1) _G.rayDisp1=0.03 _G.rayDisp2=0.08
_G.impact=Instance.new("Part") _G.impact.Anchored=true _G.impact.Transparency=0.1 _G.impact.CanCollide=false _G.impact.formFactor="Custom" _G.impact.Size=Vector3.new(0.1,0.1,0.1) fire=Instance.new("Fire", _G.impact) fire.Color=Color3.new(0, 0, 256-153) fire.SecondaryColor=Color3.new(1, 0, 0) fire.Enabled=true fire.Heat=1 fire.Size=2 _G.impDisp=0.05
_G.hole=Instance.new("Part") _G.hole.Anchored=true _G.hole.CanCollide=false _G.hole.formFactor="Custom" _G.hole.Size=Vector3.new(.2,.2,.2) _G.hole.BrickColor=BrickColor.new("Black") _G.holeDisp=3
-- if game.Players.LocalPlayer.Name == "GustFlame" then -- script.Parent.Handle.Fire.SoundId = "http://www.roblox.com/asset/?id=130833677" -- script.Parent.Handle.Fire.Pitch = 1 -- end -- done -- _G.GunStatsLoaded=true |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Jun 2014 04:06 PM |
Be carfull, your but might get hurt by how many _G Strings you have.
Get it..No? Okay.. |
|
|
| Report Abuse |
|
|
Vicctus
|
  |
| Joined: 05 Sep 2013 |
| Total Posts: 589 |
|
| |
|
Vicctus
|
  |
| Joined: 05 Sep 2013 |
| Total Posts: 589 |
|
| |
|
|
| 09 Jun 2014 04:14 PM |
You have a lot of global variables, and a variable can be _G.String="lol" |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2014 04:14 PM |
| Where is the reload function? As a matter of fact, where is the firing function? All I see is a bunch of global variables. |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2014 04:16 PM |
@LordMatthew:
I usually think of script-ers as cold, forbearing, and decisive. But apparently scripting does not irritate one to the point of losing their sense of humor. Lol.
Anyway, I do agree the coding is rather...messy. I do not see a reload mechanic.
You could either use a KeyBinding function or make reloading automatic.
Automatic:
(enabled = true)
if Ammo < 1 and enabled == true then enabled = false ReL = Instance.new("Sound", script.Parent) ReL.SoundId = "[Insert sound ID here]" ReL.Volume = 1 ReL.Pitch = 1 ReL:Play() game.Debris:AddItem(ReL, 1) wait([However long it takes the reload sound to play]) ReL:Destroy() Ammo = MaxAmmo enabled = true end
Sorry, I had to post this and leave before writing down the KeyBinding function. |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2014 04:19 PM |
Only group scripters are cold and heartless, Most scripters actully turn into more like noobs than anything, for example, A person without scripting knowledge: Hello, how has your day been? Scripting knowledge: yo watz up |
|
|
| Report Abuse |
|
|