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: Help With This Script

Previous Thread :: Next Thread 
police157 is not online. 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
cornholio234 is not online. cornholio234
Joined: 22 Oct 2010
Total Posts: 15142
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 is not online. 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 is not online. police157
Joined: 21 Feb 2009
Total Posts: 790
31 Dec 2014 10:11 AM
idk why there are 3 end's...also...
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