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
 

One question about raycast script.

Previous Thread :: Next Thread 
Moscow1234 is not online. Moscow1234
Joined: 01 May 2009
Total Posts: 652
21 Mar 2013 09:21 PM
If I add raycast script on AK-74M, What's next after that?
Report Abuse
UnAdmin is not online. UnAdmin
Joined: 10 Jul 2012
Total Posts: 4706
21 Mar 2013 09:22 PM
See if the script works?
Report Abuse
Moscow1234 is not online. Moscow1234
Joined: 01 May 2009
Total Posts: 652
21 Mar 2013 09:23 PM
@UnAdmin: Okay...
Report Abuse
Usering is not online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
21 Mar 2013 09:24 PM
What's an 'AK-74M?'

~ Failure is the road to success ~
Report Abuse
Moscow1234 is not online. Moscow1234
Joined: 01 May 2009
Total Posts: 652
21 Mar 2013 09:27 PM
@Usering: AK-74M is a Russian gun made in russia.
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
21 Mar 2013 09:30 PM
How do you ray cast a physical Russian gun D:

Maybe try a virtual one...

:D

Report Abuse
Moscow1234 is not online. Moscow1234
Joined: 01 May 2009
Total Posts: 652
21 Mar 2013 09:32 PM
@notsopwnedg: That's what I'm making a gun on ROBLOX, Not in real life.
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
21 Mar 2013 09:32 PM
You should really be more specific...
Report Abuse
whizzmaster5000 is not online. whizzmaster5000
Joined: 29 Mar 2009
Total Posts: 3013
21 Mar 2013 09:34 PM
Go into the script and see what part name is set to where the ray comes out, sometimes it's "tip" or "barrel". If you can't find it, it's possible the ray doesn't have a part-based generation, but if you do, name the brick you want the ray to come out of what the script specifies.

-Whizz
Report Abuse
Moscow1234 is not online. Moscow1234
Joined: 01 May 2009
Total Posts: 652
21 Mar 2013 09:36 PM
@notsopwnedg: What do you mean? I'm not copying like similar guns what everybody use. I'm making my own. I have my clan called 'Russian Military Force' that many people wanted me to make my own models.
Report Abuse
Moscow1234 is not online. Moscow1234
Joined: 01 May 2009
Total Posts: 652
21 Mar 2013 09:38 PM
@whizzmaster5000: Okay, Thanks. I'd hope it will works.
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
21 Mar 2013 09:39 PM
What?
I was saying you should be more specific if you gun was Roblox Specific or not...


Anyways...

This is a simple simple laster gun script i made...A gun script would be pretty similar.




local Player = Game.Players.LocalPlayer
local Tool = script.Parent;
local Main = {};
Main.DeActive = function()

end;

Main.Clicked = function(Mouse)
print("Clicked");
local Beam = Ray.new(
Tool.Handle.CFrame.p
,
(Mouse.Hit.p - Tool.Handle.CFrame.p).unit
);
print((Mouse.Hit.p - Tool.Handle.CFrame.p),(Mouse.Hit.p - Tool.Handle.CFrame.p).unit,(Mouse.Hit.p - Tool.Handle.CFrame.p).unit*300);

local Part,Pos = Workspace:FindPartOnRay(Beam);
if Part.Parent:FindFirstChild("Humanoid") then
Part.Parent.Humanoid:TakeDamage(10);
end;
local distance = (Pos - Tool.Handle.CFrame.p).magnitude;
local Part = Instance.new("Part",Workspace.CurrentCamera);
Part.Anchored = true;
Part.Size = Vector3.new(0.05, 0.05, distance);
Part.CFrame = CFrame.new(Pos, Tool.Handle.CFrame.p) * CFrame.new(0, 0, -distance/2);
Part.CanCollide = false;
Game.Debris:AddItem(Part,3);
end;


Tool.Equipped:connect(function(Mouse)
Mouse.Button1Down:connect(function()
Main.Clicked(Mouse);
end);
end);
Tool.Unequipped:connect(Main.DeActive);
Report Abuse
Moscow1234 is not online. Moscow1234
Joined: 01 May 2009
Total Posts: 652
25 Mar 2013 09:28 PM
@notsopwnedg: Penguinhardy told me he use raycast script on the AK-47 so that way it won't have a lag.
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