|
| 07 Aug 2014 09:18 AM |
Well I've posted this in SH before, and I've tried doing it myself, but it's just not working, and I got no reply, so I come here with a YT video showing whats wrong too.
I need to find out what side of this "Brick" I am standing on, my current system doesn't work to well. Could you please try to fix it, or help me figure it out? It's okay if you redo my math.
--Not my entire script, just the main parts
function ray(part1,part2) local ray=Ray.new(part1.Position,(Vector3.new(part1.Position.X,part2.Y,part2.Z)-part1.Position).Unit*10) -- sends ray from the torsos X position to the mouse.Hit.p's Z and Y local part,position=workspace:FindPartOnRayWithIgnoreList(ray,{torso}) return part end
mouse.Button1Down:connect(function() local target=mouse.Target if target and torso and char.Humanoid.Health>0 then if target.Name=="Bar" then local item=ray(torso,mouse.Hit.p) if item and item.Name=="Bar" then local ix=item.Position.X local iz=item.Position.Z local tx=torso.Position.X local tz=torso.Position.Z local topright=false local topleft=false local botright=false local botleft=false local side if ix > tx then topright=true end if iz > tz then topleft=true end if tx > iz then botright=true end if tz > ix then botleft=true end if topright and topleft then side=1 end if topleft and botright then side=2 end if botright and botleft then side=3 end if botleft and topright then side=4 end print(side) else print("NOPE") end end end end) |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2014 09:18 AM |
| https://www.youtube.com/watch?v=CfdqawGehbg&feature=youtu.be |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 07 Aug 2014 08:50 PM |
| I did a glitch, but I seriously need some help. |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2014 08:54 PM |
This entire broken block of code is trying to tell me what, of the four sides of the bar, I am on.
Please help me..
local ix=item.Position.X local iz=item.Position.Z local tx=torso.Position.X local tz=torso.Position.Z local topright=false local topleft=false local botright=false local botleft=false local side if ix > tx then topright=true end if iz > tz then topleft=true end if tx > iz then botright=true end if tz > ix then botleft=true end if topright and topleft then side=1 end if topleft and botright then side=2 end if botright and botleft then side=3 end if botleft and topright then side=4 end print(side) |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2014 03:23 AM |
hmm, ik that you need to do something
Nursing a baby pinecone back to health |
|
|
| Report Abuse |
|
|
| |
|