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: Tool Help

Previous Thread :: Next Thread 
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
31 Jul 2013 06:25 PM
How do you make a script that shoots a part right infront of you on activated?
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
31 Jul 2013 06:26 PM
Well if you want it to shoot like a fire arm then use Raycasting. Otherwise you can use Velocity and lookVector to accomplish this.
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
31 Jul 2013 06:27 PM
Can i have the code?
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
31 Jul 2013 06:28 PM
For Look Vector
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
31 Jul 2013 06:29 PM
thanks :D
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
31 Jul 2013 06:32 PM
No you can't this is scripting helpers not scripters give you scripts
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
31 Jul 2013 06:32 PM
Anyone???
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
31 Jul 2013 06:34 PM
Can you at least help my im new to scripting
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
31 Jul 2013 06:38 PM
Plz
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
31 Jul 2013 06:43 PM
Bump 1
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
31 Jul 2013 06:55 PM
PLZ COME ON ROBLOXIANS
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
31 Jul 2013 07:03 PM
"This is scripting helpers not scripting givers"
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
31 Jul 2013 07:43 PM
ik plz
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
31 Jul 2013 07:57 PM
bump2
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
31 Jul 2013 08:00 PM
No one has helped you the last 8 bumps, were not going to just code it for you.

Try to figure it out with these tutorials:

http://wiki.roblox.com/index.php/How_to_Make_a_Raycasting_Lasergun

http://wiki.roblox.com/index.php/LookVector#Properties
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
31 Jul 2013 08:22 PM
ok thx
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
01 Aug 2013 06:08 AM
Can some help me with look vector?
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
01 Aug 2013 06:23 AM
What do you not understand?
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
01 Aug 2013 07:55 AM
everything
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
01 Aug 2013 07:59 AM
Okay... What part of scripting do you understand?
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
01 Aug 2013 08:43 AM
for i
function
while true do
properties
wait(1)
operators
prints
cmommands
strings
tables
bools
values
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
01 Aug 2013 08:59 AM
Hello
Report Abuse
laughablehaha is not online. laughablehaha
Joined: 19 Apr 2012
Total Posts: 2495
01 Aug 2013 09:44 AM
This is only nessecary if you want a flashlight attachment.

tool = script.Parent
plr = game.Players.LocalPlayer
script.Parent:WaitForChild("plr").Value = plr

mouse = nil
con = nil
on = false

tool.Equipped:connect(function(mse)
mouse = mse
mouse.Icon = "rbxasset://textures\\GunCursor.png"
con = mouse.KeyDown:connect(function(key)
if key =="l" then -- Press "l" to disable and enable light.
if on then
script.Parent.Handle.SpotLight.Enabled = false
on = false
else
script.Parent.Handle.SpotLight.Enabled = true
on = true
wait(800)
script.Parent:remove()
end
end
end)
end)
tool.Unequipped:connect(function()
con:disconnect()
end)


script.Parent.Reloading.Changed:connect(function()
if script.Parent.Reloading.Value then
mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
else
mouse.Icon = "rbxasset://textures\\GunCursor.png"
end
end)

This is the gun script.
local tool = script.Parent
local reloading = script.Parent.Reloading

function fire(d)

bullet = Instance.new("Part")
bullet.FormFactor = "Custom"
bullet.Size = Vector3.new(0.4,0.2,0.2)
bullet.BrickColor = BrickColor.new("Really black")
bullet.Position = tool.Handle.Position + (d*5)
bullet.Velocity = d*100

bullet.Touched:connect(function(hit)
bullet:remove()
chr = hit.Parent
if game.Players:GetPlayerFromCharacter(chr) and chr:findFirstChild("Humanoid") then
plr = game.Players:GetPlayerFromCharacter(chr)
if chr.Humanoid.Health > 0 then
chr.Humanoid:TakeDamage(math.random(10,20))
end
end
end)

force = Instance.new("BodyForce")
force.force = Vector3.new(0,3,0)
force.Parent = bullet

bullet.Parent = game.Workspace

end
tool.Activated:connect(function()

if tool.Enabled and not reloading.Value then

chr=tool.Parent

if game.Players:GetPlayerFromCharacter(chr)==script.Parent.plr.Value then

if chr:findFirstChild("Humanoid") then

if chr.Humanoid.Health >0 then
reloading.Value = true
hum = chr.Humanoid

targetPos = hum.TargetPoint
lookAt = (targetPos-chr.Head.Position).unit
fire(lookAt)

wait(0.5)

reloading.Value = false
end
end
end
end

end)


There you go! ;)
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