Rules: http://robloxsociality.forumotion.com/t5-rules-of-the-forums
 
HomePortalMemberlistRegisterLog in

Share | 
 

 This script is not running pretty well (Lua)

Go down 
AuthorMessage
dbb



Posts : 9
Joined : 2011-12-17

PostSubject: This script is not running pretty well (Lua)   Tue Mar 06, 2012 11:18 pm

Is there anyway I can reduce this (or make it work?)
while true do
wait(.5) --
p = game.Workspace:FindPartsInRegion3(Region3.new(Vector3.new(script.Parent.Position.X,script.Parent.Position.Y,script.Parent.Position.Z),Vector3.new(300,300,300)), nil, 100)
negativepos = Vector3.new(script.Parent.Position.X - 300, script.Parent.Position.Y - 300, script.Parent.Position.Z - 300)
positivepos = Vector3.new(script.Parent.Position.X 300, script.Parent.Position.Y 300, script.Parent.Position.Z 300)
p = game.Workspace:FindPartsInRegion3(Region3.new(negativepos, positivepos), nil, 100)
for i = 1, #p do
h = p[i]:findFirstChild("target")
if h then
local dob = Instance.new("BodyPosition")
dob.Parent = script.Parent
dob.position = p[i].Position
dob.maxForce = Vector3.new(9999,9999,9999)
wait()
print(p[i])
wait()
end
end
end

Back to top Go down
View user profile
ZippyArnold123456789
Administrator
Administrator


Joined Roblox : 17 Aug 2004
Posts : 10
Joined : 2011-12-17

PostSubject: Solution to your script problem   Tue Mar 06, 2012 11:48 pm

local dob = Instance.new("BodyPosition", script.Parent)
dob.maxForce = Vector3.new(0,0,0)
dob.Name = "DP"
local trace_part = Instance.new("Vector3Value", script.Parent)
trace_part.Name = "VCT"
--disabled force so we can go back to it without it having a split-error environmental change
while true do
wait(.5)
negativepos = Vector3.new(script.Parent.Position.X - 700, script.Parent.Position.Y - 700, script.Parent.Position.Z - 700)
positivepos = Vector3.new(script.Parent.Position.X + 700, script.Parent.Position.Y + 700, script.Parent.Position.Z + 700)
p = game.Workspace:FindPartsInRegion3(Region3.new(negativepos, positivepos), nil, 100)
for i = 1, #p do
h = p[i]:findFirstChild("target")
if h then
tracep = script.Parent:findFirstChild("VCT")
eces = script.Parent:findFirstChild("DP")
if eces and tracep then
tracep.Value = p[i].Position
eces.position = tracep.Value
eces.maxForce = Vector3.new(8990,9255,8990)
wait()
print(p[i])
wait()
end
end
end
end




Should work! Razz
No offense, but you missed some operators in one of your variables.
Back to top Go down
View user profile
dbb



Posts : 9
Joined : 2011-12-17

PostSubject: Re: This script is not running pretty well (Lua)   Wed Mar 07, 2012 12:02 am

THANKS ZIPPY!!! Very Happy
Back to top Go down
View user profile
dbb



Posts : 9
Joined : 2011-12-17

PostSubject: Re: This script is not running pretty well (Lua)   Wed Mar 07, 2012 5:51 pm

o_o
Back to top Go down
View user profile
ZippyArnold123456789
Administrator
Administrator


Joined Roblox : 17 Aug 2004
Posts : 10
Joined : 2011-12-17

PostSubject: Re: This script is not running pretty well (Lua)   Wed Mar 07, 2012 5:52 pm

What?

_________________

Back to top Go down
View user profile
dbb



Posts : 9
Joined : 2011-12-17

PostSubject: Re: This script is not running pretty well (Lua)   Wed Mar 07, 2012 5:54 pm

I almost posted something as if I were you, but thanks again for the script.
Back to top Go down
View user profile
ZippyArnold123456789
Administrator
Administrator


Joined Roblox : 17 Aug 2004
Posts : 10
Joined : 2011-12-17

PostSubject: Re: This script is not running pretty well (Lua)   Wed Mar 07, 2012 5:55 pm

You're welcome.
Btw, I need to resynchronize you Razz

_________________

Back to top Go down
View user profile
Mathepa
Moderator + Mental Specialist
Moderator + Mental Specialist


Posts : 29
Joined : 2011-12-21

PostSubject: Re: This script is not running pretty well (Lua)   Thu Mar 13, 2014 3:32 pm

I remember seeing this....
qq!
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: This script is not running pretty well (Lua)   

Back to top Go down
 
This script is not running pretty well (Lua)
Back to top 
Page 1 of 1
 Similar topics
-
» Chess Script
» Need a running track
» running light...
» Another Cinderella Story Movie Script
» Firefox 4 - Mybrute stuff

Permissions in this forum:You cannot reply to topics in this forum
Roblox Social Forums :: ROBLOX :: Scripting Helpers-
Jump to: