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: easy fix

Previous Thread :: Next Thread 
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
23 Nov 2015 12:45 PM
local part, position = workspace:FindPartOnRayWithIgnoreList(ray,game.Players.LocalPlayer.Character,{cueball})


something's wrong with this, i hate raycasting.
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
23 Nov 2015 12:49 PM
.-.
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
23 Nov 2015 12:52 PM
Slow day I guess?

Bump..
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
23 Nov 2015 12:54 PM
It doesn't take a table for the third argument. It takes a boolean. The second argument takes a table, and you aren't giving it a table for the second argument.


















Technically, it takes a table for the third argument, but you are giving your table in the fourth, but disregard this if you are confused now.
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
23 Nov 2015 12:58 PM
-Lightbulb appears-

Oh! Let me make some edits.. Thanks!
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
23 Nov 2015 01:02 PM
Full section:

Now the part where it checks to see if there are any obstructing balls in the ray's path isn't working. What it's supposed to do if there are any obstructing balls in the path is to recalculate the ray before the actual beam is made.


local ray = Ray.new(cue.Point.CFrame.p,cue.Point.CFrame.lookVector.unit * 300)
local part, position = workspace:FindPartOnRayWithIgnoreList(ray,{game.Players.LocalPlayer,cueball})
if part then
pcall(function()
if string.match(part.Name,"Ball") then
print(math.random(1,50000))
ray = Ray.new(cue.Point.CFrame.lookVector,part.Position).unit * 300
end
end)
end
local beam = Instance.new("Part", workspace)
beam.BrickColor = BrickColor.new("Black")
beam.FormFactor = "Custom"
beam.Material = "Neon"
beam.Transparency = .3
beam.Anchored = true
beam.Locked = true
beam.CanCollide = false
local distance = (cue.Point.CFrame.lookVector - position).magnitude
beam.Size = Vector3.new(.1,.1,distance)
beam.CFrame = CFrame.new(cue.Point.CFrame.p,position) * CFrame.new(0,0,-distance / 2)
current_ray = beam
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
23 Nov 2015 01:04 PM
Okay I got it to actually print something, but it won't recalculate the ray. :(
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
23 Nov 2015 01:08 PM
Doesn't seem to be changing the 'ray' variable, cause I put a print after the code did that but it never printed, it just printed the random numbers.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
23 Nov 2015 01:13 PM
"game.Players.LocalPlayer"
No descendants of LocalPlayer will be Parts anyways, so you can just remove that, unless you mean Character, in which case you should change it.
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
23 Nov 2015 01:14 PM
Oh lol. But back to the problem pls?
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
23 Nov 2015 01:19 PM
Ah it was one of those probs where you had to put in a wait() and first make the Ray variable nil.. :P

But now it's a math problem:

ray = Ray.new(cue.Point.CFrame.lookVector,part.Position)


I need to generate a ray from the Point's looking direction to the part's position, not going through it.
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
23 Nov 2015 01:24 PM
Think I'm gonna ask for a bump.
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
23 Nov 2015 02:08 PM
bump
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
23 Nov 2015 02:15 PM
Bump
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