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 » Scripting Helpers
Home Search
 

Re: Bullet won't fire out.

Previous Thread :: Next Thread 
newnoahdain is not online. newnoahdain
Joined: 07 Jan 2010
Total Posts: 217
12 Oct 2011 04:14 AM
I am creating an american revolution tribute as a place, but in a musket I just made, the bullet shoots, but will NOT go foreward. It has velocity, and all. Here is the script:


smoke = script.Parent.Muzzle.Smoke
Tool = script.Parent
VELOCITY = 60
loaded=false

local Bullet = Instance.new("Part")
Bullet.Size = Vector3.new(0.2,0.2,0.2)
Bullet.Shape = 0
Bullet.formFactor = ("Custom")
Bullet.BrickColor = BrickColor.new("Really black")
Bullet.Material = Enum.Material.Plastic
Bullet.Locked = true
Bullet.TopSurface = 0
Bullet.BottomSurface = 0

script.Parent.ballScript:clone().Parent = Bullet



function fire(v, shootDirect)


local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)

local head = vCharacter:findFirstChild("Head")
if head == nil then return end

Tool.Handle.Fire:Play()
local launch = head.Position + 10 * v

local missile = Bullet:clone()
missile.CFrame = CFrame.new(launch,shootDirect)
missile.Position = launch
missile.Velocity = v * 300

local force = Instance.new("BodyForce")
force.force = Vector3.new(0,98,0)
force.Parent = missile

missile.ballScript.Disabled = false


missile.Parent = game.Workspace

end

function Recoil1()
Tool.GripPos = Vector3.new(0,0,0.8)
end

function Recoil2()
Tool.GripPos = Vector3.new(0,0,1)
end

function onEquipped()

Tool.Handle.Fire:Stop()

end

function onUnequipped()

Tool.Handle.Fire:Stop()

end

Tool.Equipped:connect(onEquipped)
Tool.Unequipped:connect(onUnequipped)


enabled = true
function onActivated()
if not enabled then
return
end

enabled = false


local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Failed to find Player's Humanoid")
return
end

local targetPos = humanoid.TargetPoint
local lookAt = (targetPos - character.Head.Position).unit
shootDirect = targetPos

local reload = .5

smoke.Enabled = true
Recoil1()
fire(lookAt, shootDirect)
wait(reload)
smoke.Enabled = false
Recoil2()
wait(reload)

enabled = true

end

script.Parent.Activated:connect(onActivated)

If you want to test it to see what happens, go to my place. I only have one place, I see no reason why I should post a link.
Report Abuse
newnoahdain is not online. newnoahdain
Joined: 07 Jan 2010
Total Posts: 217
12 Oct 2011 04:46 AM
30 minutes......
Report Abuse
newnoahdain is not online. newnoahdain
Joined: 07 Jan 2010
Total Posts: 217
12 Oct 2011 02:44 PM
Bump of - Thanks for ignoring my post.
Report Abuse
newnoahdain is not online. newnoahdain
Joined: 07 Jan 2010
Total Posts: 217
12 Oct 2011 02:55 PM
Bump - realize it wasn't off of the page, but the further to the bottom it is, it is much less likely to be read..
Report Abuse
Noobster5oo is not online. Noobster5oo
Joined: 18 Aug 2011
Total Posts: 2975
12 Oct 2011 02:56 PM
Wheres the output?

-The guy with the siggy that little kids find inappropriate yet it isn't.
Report Abuse
newnoahdain is not online. newnoahdain
Joined: 07 Jan 2010
Total Posts: 217
12 Oct 2011 02:57 PM
Everything works, the bullet just doesn't fly forward. If the output would have detected a problem, the gun wouldn't shoot at all.
Report Abuse
newnoahdain is not online. newnoahdain
Joined: 07 Jan 2010
Total Posts: 217
12 Oct 2011 03:04 PM
At the top - The initial scripts loaded
After that - The scripts transfered to the bullet when shot (A few test shots)

Wed Oct 12 16:02:05 2011 - Running Script "Players.newnoahdain.Backpack.Musket.BallLauncher"
Wed Oct 12 16:02:25 2011 - Running Script "Workspace.Part.ballScript"
Wed Oct 12 16:02:30 2011 - Running Script "Workspace.Part.ballScript"
Wed Oct 12 16:02:33 2011 - Running Script "Workspace.Part.ballScript"
Wed Oct 12 16:02:37 2011 - Running Script "Workspace.Part.ballScript"
Wed Oct 12 16:02:39 2011 - Running Script "Workspace.Part.ballScript"
Wed Oct 12 16:02:40 2011 - Running Script "Workspace.Part.ballScript"
Report Abuse
newnoahdain is not online. newnoahdain
Joined: 07 Jan 2010
Total Posts: 217
12 Oct 2011 03:21 PM
Anyone???
Report Abuse
veowe4 is not online. veowe4
Joined: 29 May 2010
Total Posts: 72
12 Oct 2011 03:29 PM
Hey there, Im no good with scripts, but I just played your game for a bit and I tried out the musket and the bullet does move.
Report Abuse
newnoahdain is not online. newnoahdain
Joined: 07 Jan 2010
Total Posts: 217
12 Oct 2011 03:32 PM
And then it freezes in place...
Report Abuse
triston220 is not online. triston220
Joined: 08 Mar 2010
Total Posts: 1861
12 Oct 2011 03:45 PM
Increase the velocity?
Report Abuse
newnoahdain is not online. newnoahdain
Joined: 07 Jan 2010
Total Posts: 217
12 Oct 2011 03:56 PM
Do you see how fast it is? The bullet is unanchored, but it just acts as if it is anchored...
Report Abuse
newnoahdain is not online. newnoahdain
Joined: 07 Jan 2010
Total Posts: 217
12 Oct 2011 04:32 PM
Yes. Thank you all for the help.................. (You better see the sarcasm in this.)
Report Abuse
newnoahdain is not online. newnoahdain
Joined: 07 Jan 2010
Total Posts: 217
12 Oct 2011 04:33 PM
Truly though, thank you to the few that tried helping.....
Report Abuse
dragon829 is not online. dragon829
Joined: 12 Aug 2008
Total Posts: 741
12 Oct 2011 04:34 PM
they tried giving you all the help they can dont be mad cause its not fixed i have alot of stuff people dont fix i dont care i try again later so dont be so upset
Report Abuse
dragon829 is not online. dragon829
Joined: 12 Aug 2008
Total Posts: 741
12 Oct 2011 04:35 PM
latepost lol sorry
Report Abuse
thatkane is not online. thatkane
Joined: 25 Feb 2011
Total Posts: 17078
12 Oct 2011 04:37 PM
Stolen.
Report Abuse
Chunkyblox is not online. Chunkyblox
Joined: 26 Apr 2009
Total Posts: 151
12 Oct 2011 05:07 PM
Just use free models
Report Abuse
newnoahdain is not online. newnoahdain
Joined: 07 Jan 2010
Total Posts: 217
12 Oct 2011 05:11 PM
@kane - No, I built it and scripted it myself

@ chunkyblox - Hell no!
Report Abuse
thatkane is not online. thatkane
Joined: 25 Feb 2011
Total Posts: 17078
12 Oct 2011 05:22 PM
Lol, i seen the script.
Report Abuse
DeHata is not online. DeHata
Joined: 02 Oct 2011
Total Posts: 617
13 Oct 2011 04:10 AM
And Lol, I remember writing it (newnoahdain is my alt...).
Report Abuse
DeHata is not online. DeHata
Joined: 02 Oct 2011
Total Posts: 617
13 Oct 2011 04:11 AM
Also, Why the hell would I steal a broken script?
Report Abuse
DeHata is not online. DeHata
Joined: 02 Oct 2011
Total Posts: 617
13 Oct 2011 06:37 AM
Please, humor me with your response to that.
Report Abuse
thatkane is not online. thatkane
Joined: 25 Feb 2011
Total Posts: 17078
13 Oct 2011 07:42 AM
Well i was at my friends house, and he was checking scripting forums. He said "OH MY GOD! That's my script!!" and i said "Hmm?" and he was histarical at a exact replica of his musket script. I'm not sure if you stole it or not, but i trusted my friend if you didn't make it.
Report Abuse
DeHata is not online. DeHata
Joined: 02 Oct 2011
Total Posts: 617
13 Oct 2011 08:40 AM
Well tell your friend, I mean no offense, but I am 100% Positive I made this. We may have similar scripts, but I am sure his works, while mine doesn't.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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