police157
|
  |
| Joined: 21 Feb 2009 |
| Total Posts: 790 |
|
|
| 31 Dec 2014 09:57 AM |
Okay so this is a script in a Part and for some reason the part disappears within a matter of seconds. If that could be resolved great! Another thing I need help with is whenever a Player jumps the Player doesn't jump with it's regular gravity. I'm not a great scripter so try to simplify anything you say to me, if possible.
----------------------------------------------------------------------------------------
while wait(1) do if script.Parent.Parent==workspace and script.Parent.Velocity.magnitude<30 then local closest,dist; for _,v in pairs(game.Players:GetChildren()) do if v:DistanceFromCharacter(script.Parent.Position)<5 and v.lastSpeed.Value<6 then if not dist or dist>v:DistanceFromCharacter(script.Parent.Position) then closest=v; dist=v:DistanceFromCharacter(script.Parent.Position); end end end if closest then pcall(function() script.Parent.force:Destroy(); end); local tool=game.Lighting.Ball:clone(); local new_ball=script.Parent:clone(); new_ball.Name="Handle"; new_ball.Size=Vector3.new(1,1,1); new_ball.RotVelocity=Vector3.new(); new_ball.Velocity=Vector3.new(); new_ball.Parent=tool; workspace.IR.Ball.Value=new_ball; tool.Parent=closest.Character; game:GetService("Debris"):AddItem(script.Parent,0); end end end
----------------------------------------------------------------------------------------
Please help :D Thanks in advance :3 |
|
|
| Report Abuse |
|
|
|
| 31 Dec 2014 10:05 AM |
| Your code is a bit messy, try to space it out to make it more understandable, also, I'm not sure but why do you have 3 ends on the same line? |
|
|
| Report Abuse |
|
|
police157
|
  |
| Joined: 21 Feb 2009 |
| Total Posts: 790 |
|
|
| 31 Dec 2014 10:10 AM |
while wait(1) do if script.Parent.Parent==workspace and script.Parent.Velocity.magnitude<30 then local closest,dist; for _,v in pairs(game.Players:GetChildren()) do if v:DistanceFromCharacter(script.Parent.Position)<5 and v.lastSpeed.Value<6 then if not dist or dist>v:DistanceFromCharacter(script.Parent.Position) then closest=v; dist=v:DistanceFromCharacter(script.Parent.Position); end end end
if closest then pcall(function() script.Parent.force:Destroy(); end); local tool=game.Lighting.Ball:clone(); local new_ball=script.Parent:clone(); new_ball.Name="Handle"; new_ball.Size=Vector3.new(1,1,1); new_ball.RotVelocity=Vector3.new(); new_ball.Velocity=Vector3.new(); new_ball.Parent=tool; workspace.IR.Ball.Value=new_ball; tool.Parent=closest.Character; game:GetService("Debris"):AddItem(script.Parent,0); end end end
Sorry this isn't my script :( I'm just using the script for my game to work... |
|
|
| Report Abuse |
|
|
police157
|
  |
| Joined: 21 Feb 2009 |
| Total Posts: 790 |
|
|
| 31 Dec 2014 10:11 AM |
| idk why there are 3 end's...also... |
|
|
| Report Abuse |
|
|