generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Can anyone help me??

Previous Thread :: Next Thread 
killaman333 is not online. killaman333
Joined: 16 Jan 2013
Total Posts: 1143
14 Jun 2015 07:59 AM
The problem in my script is the bullet won't fly forward. (It is a gun script) So can someone please correct my script?

----------------------------------------------------------
------------ Made by killaman333 -------------
---------------------------------------------------------

function click(Guy)
----------------------------------------------------------
------------------ VAIRIABLES -------------------
---------------------------------------------------------
local con = script.Parent.Configuration
local Bullet_Life = con.Bullet_Life.Value
local damage = con.Damage.Value
local Fire_Rate = con.Fire_Rate.Value -- Do not change number to Uneven value such as
-- (0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.6 or so on *If you proceed to disreguard these intruction, The script will break*)
local Speed = con.Speed.Value
local R_time = con.Reload_Time.Value
local Total_Ammo = con.Total_Ammo
local Bullet_Position = script.Parent.BulletPOS.Position
local mesh = Instance.new("SpecialMesh")
local bullet = Instance.new("Part")
----------------------------------------------------------
----------------- MAIN SCRIPT ------------------
----------------------------------------------------------
bullet.Parent = script.Parent
bullet.Name = ("_bullet_")
mesh.Parent = script.Parent._bullet_
mesh.Scale = Vector3.new(0.5, 0.5, 0.5)
mesh.MeshType = ("Sphere") -- Use ancestery changed method
bullet.CFrame = CFrame.new(Bullet_Position)
local CURRENT_Z = bullet.Velocity.Z

for timer = 0, Bullet_Life do
bullet.Velocity = (Vector3.new(0, 0, CURRENT_Z + 1))
wait(1)
end

for time = Fire_Rate, 0, -0.1 do
script.Disabled = true
wait(0.1)
end
script.Disabled = false
bullet:Destroy()


end
script.Parent.Activated:connect(click)

i have'nt finished yet but i'm having trouble with the shooting
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
14 Jun 2015 08:06 AM
Setting the velocity of an part doesn't work to well. (Always wondered why...)

Use a BodyMover like BodyVelocity instead.
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
14 Jun 2015 08:07 AM
also, I advise against doing anything like this:

script.Disabled = true
Report Abuse
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
14 Jun 2015 08:07 AM
@builder

this works fine

part.Velocity = Mouse.Hit.lookVector*Power
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
14 Jun 2015 08:51 AM
Does it? hmm... If I remember correctly that always fell down like a brick when I tried that.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image