|
| 04 Jan 2014 07:45 PM |
ok,so heres the script..
its a tool,with a handle,with a script in it.. -Tool -Script -Handle -TouchInterest
ok,so in the script..here it is: del = 0 del2 = 0 b = Instance.new("Part") script.Parent.Activated:connect(function() print("Button1Down") a = b:clone() a.Size = Vector3.new(1,1,2) a.Parent = Workspace a.BrickColor = BrickColor.new("Dark stone grey") a.Name = "Rocket" a.Position = Workspace.Player1.Head.Position + Vector3.new(0,1,0) local playerIsFacing = workspace.Player1.Head.CFrame.lookVector local angle = math.atan(playerIsFacing.X, playerIsFacing.Z) a.CFrame = CFrame.new(a.Position) * CFrame.Angles(0, angle + math.pi, 0) V = Instance.new("BodyVelocity",a) while wait(0.1) do V.velocity = a.CFrame.lookVector * 30 if del < 50 then del = del+1 else if del2 == 0 then e = Instance.new("Explosion",Workspace) e.BlastPressure = 1000 e.BlastRadius = 5 e.Parent = a e.Position = a.Position if del2 < 10 then del2 = del2+1 else a:remove() end end end end end) function Touch(hit) e = Instance.new("Explosion",Workspace) e.BlastPressure = 1000 e.BlastRadius = 5 e.Position = a.Position end b.Touched:connect(Touch) but for some reason,it doesn't turn to face me,it just goes one direction.. whats rong?? |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 07:46 PM |
to face the way I face* that's what I meant.. also,i tried an edit,but this one goes crazy.. b = script.Parent.Rocket script.Parent.Activated:connect(function() print("Button1Down") del = 0 del2 = 0 a = b:clone() a.Size = Vector3.new(1,1,2) a.Transparency = 0 a.CanCollide = true a.Anchored = false a.Parent = Workspace a.BrickColor = BrickColor.new("Dark stone grey") a.Name = "Rocket" a.Position = Workspace.Player1.Head.Position + Vector3.new(0,1,0) local playerIsFacing = workspace.Player1.Head.CFrame.lookVector local angle = math.atan(playerIsFacing.X, playerIsFacing.Z) a.CFrame = CFrame.new(a.Position) * CFrame.Angles(0, angle + math.pi, 0) V = Instance.new("BodyVelocity",a) while wait(0.1) do V.velocity = a.CFrame.lookVector * 30 if del < 50 then del = del+1 else if del2 == 0 then e = Instance.new("Explosion",Workspace) e.BlastPressure = 1000 e.BlastRadius = 5 e.Parent = a e.Position = a.Position if del2 < 10 then del2 = del2+1 else a:remove() end end end end end) function Touch(hit) e = Instance.new("Explosion",Workspace) e.BlastPressure = 1000 e.BlastRadius = 5 e.Position = a.Position end a.Touched:connect(Touch) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
xSIXx
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 9202 |
|
|
| 04 Jan 2014 08:05 PM |
dude
you are giving us a long script which is probably a free model and not even telling us what is wrong.
we are not going to help you. |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 08:07 PM |
| WTH!IT IS NOT A FREE MODEL,I MADE IT MYSELF,AND IT WONT FIRE FORWARD,ALL I WANT IS HOW TO MAKE IT FACE THE SAME WAY AS THE TOOL,CANT ANYONE HELP? |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 04 Jan 2014 08:09 PM |
Tool.Handle.CFrame = Cframe.new(tool.handle.position,mouse.hit.p)
Loop that. Variables arent capitalised right cos mobile phe is awkeard to use |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 08:10 PM |
BUMP(any comments saying its a free model will be reported..)
its not a free model,it took me a long time to script that, and it don't even work.. all I want is for it to face the same way as the tool... |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 08:11 PM |
| @ rofl,im not sure what ur talking about.. |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 04 Jan 2014 08:12 PM |
| I misunderstood. Whats erong exactly |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 08:13 PM |
alls good,except for the fact that the rocket wont face the way I want it to..forward.. it always goes one way,no matter which way im facing.. |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 08:13 PM |
this is where im having the problem I think:
local playerIsFacing = workspace.Player1.Head.CFrame.lookVector local angle = math.atan(playerIsFacing.X, playerIsFacing.Z) a.CFrame = CFrame.new(a.Position) * CFrame.Angles(0, angle + math.pi, 0) V = Instance.new("BodyVelocity",a) while wait(0.1) do V.velocity = a.CFrame.lookVector * 30
|
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 08:16 PM |
| the above is only part of the full script btw |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 04 Jan 2014 08:17 PM |
| a.Cframe = CFrame.new(a.Position,a.Position+playerIsFacing*1000) |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 08:19 PM |
YES!!!!!!!!!!!!!!! u fixed it!thx man! b = script.Parent.Rocket script.Parent.Activated:connect(function() print("Button1Down") del = 0 del2 = 0 a = b:clone() a.Size = Vector3.new(1,1,2) a.Transparency = 0 a.CanCollide = true a.Anchored = false a.Parent = Workspace a.BrickColor = BrickColor.new("Dark stone grey") a.Name = "Rocket" a.Position = script.Parent.Handle.Position local playerIsFacing = script.Parent.Handle.CFrame.lookVector local angle = math.atan(playerIsFacing.X, playerIsFacing.Z) a.CFrame = CFrame.new(a.Position,a.Position+playerIsFacing*1000) V = Instance.new("BodyVelocity",a) while wait(0.1) do V.velocity = a.CFrame.lookVector * 30 if del < 50 then del = del+1 else if del2 == 0 then e = Instance.new("Explosion",Workspace) e.BlastPressure = 1000 e.BlastRadius = 5 e.Parent = a e.Position = a.Position if del2 < 10 then del2 = del2+1 else a:remove() end end end end end) function Touch(hit) e = Instance.new("Explosion",Workspace) e.BlastPressure = 1000 e.BlastRadius = 5 e.Position = a.Position end if a~= nil then a.Touched:connect(Touch) end |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 04 Jan 2014 08:23 PM |
| Glad to help, but it's strange that your way of doing it didnt work, i mean it lookwd fine |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 04 Jan 2014 08:24 PM |
| Might have been because you were using atan onstead of atan2 |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 08:27 PM |
when it was atan2 it went to my right,i wanted it to go forward.. im having a new problem btw.. posting a new thread.. |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 08:36 PM |
| Good Job Learning To Copy And Paste Models Aww Its Noobs First Time sniff They Grow Up so fast! |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 08:37 PM |
reporting..its not free modeled..have u EVER seen a free model like THAT? I dont like to admit it,but my script,is terrible..its NOTHING compared to other scripts.. |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 11:39 PM |
| Not In The Mood To Argue Noob |
|
|
| Report Abuse |
|
|
|
| 05 Jan 2014 10:30 AM |
| Noob? Riiight...this coming from you...stay off my threads |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Jan 2014 09:56 PM |
| Reporting..will report every time u post o my threadz.. u probably can't even script. . |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 05 Jan 2014 10:01 PM |
Island, if it's not a free model then you wouldn't be getting all defensive. Stop taking credit for other people's work.
If it is indeed yours, then explain what lookVector and atan2 even are because I've seen your scripts and they are practically mathless |
|
|
| Report Abuse |
|
|