tinarg
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
|
| 21 Apr 2014 05:45 PM |
Title says all. Lemme give an example of what's happening:
here's a segment of my code:
if child.ClassName == "Part" then if child:FindFirstChild("NoGrav") == nil then
The first line works, but it ignores the second line regardless of whether the object has "NoGrav" or not.
Can someone help please? Thanks! |
|
|
| Report Abuse |
|
|
youssef04
|
  |
| Joined: 22 Jan 2011 |
| Total Posts: 1745 |
|
| |
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
| |
|
tinarg
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
|
| 21 Apr 2014 05:48 PM |
@you
I've always used a capital, and it's always worked until now.
@vlek
I want it to only proceed if it DOESN'T have NoGrav inside it. |
|
|
| Report Abuse |
|
|
Ace23333
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 1341 |
|
|
| 21 Apr 2014 05:51 PM |
| Instead of putting in NoGrav and see if it works |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 21 Apr 2014 05:52 PM |
No space behind it? Script works fine. |
|
|
| Report Abuse |
|
|
tinarg
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
| |
|
tinarg
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
|
| 21 Apr 2014 05:53 PM |
@vlek
It works fine in solo mode, but it breaks in servers. |
|
|
| Report Abuse |
|
|
Ace23333
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 1341 |
|
| |
|
tinarg
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
|
| 21 Apr 2014 05:57 PM |
*grown*
That's impossible! The way I programmed the script won't allow it to work from any player! |
|
|
| Report Abuse |
|
|
tinarg
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
|
| 21 Apr 2014 06:00 PM |
| URGH! I HAVE THE PATIENCE OF A SQUIRREL! HALP MAH PLS!!11!!!1 |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 21 Apr 2014 06:01 PM |
| We canp u any more further with this info. :/ |
|
|
| Report Abuse |
|
|
tinarg
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
|
| 21 Apr 2014 06:02 PM |
...
Please just help me. I spent hours writing an anti-gravity script and can't finish it with this major setback! |
|
|
| Report Abuse |
|
|
Ace23333
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 1341 |
|
| |
|
tinarg
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
|
| 21 Apr 2014 06:03 PM |
--Scripted by tinarg
Workspace.ChildAdded:connect(function(child) if child.ClassName == "Model" then
for _, v in pairs(child:GetChildren()) do
if v.ClassName == "Part" or v.ClassName == "WedgePart" or v.ClassName == "TrussPart" or v.ClassName == "CornerWedgePart" or v.ClassName == "Seat" or v.ClassName == "VehicleSeat" or v.ClassName == "SkateboardPlatform" then if v:FindFirstChild("NoGrav") == nil then
local NoGrav = Instance.new("BodyForce") local FixGrav = script.FixGravity:clone()
FixGrav.Parent = v FixGrav.Disabled = false
NoGrav.Name = "NoGrav" NoGrav.force = Vector3.new(0, v:GetMass() * 196.2, 0) NoGrav.Parent = v end end end end
if child.ClassName == "Part" then if child:FindFirstChild("NoGrav") == nil then
local NoGrav = Instance.new("BodyForce") local FixGrav = script.FixGravity:clone()
FixGrav.Parent = child FixGrav.Disabled = false
NoGrav.Name = "NoGrav" NoGrav.force = Vector3.new(0, child:GetMass() * 196.2, 0) NoGrav.Parent = child
end end
if child.ClassName == "Hat" then if child:FindFirstChild("NoGrav") == nil then local NoGrav = Instance.new("BodyForce")
NoGrav.Name = "NoGrav" NoGrav.force = Vector3.new(0, child.Handle:GetMass() * 196.2, 0) NoGrav.Parent = child.Handle end end
end) |
|
|
| Report Abuse |
|
|
tinarg
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
|
| 21 Apr 2014 06:05 PM |
Another script, named FixGravity is found inside the script:
local PSize = script.Parent.Size
while true do wait(0.05) if script.Parent.Size ~= PSize then PSize = script.Parent.Size script.Parent.NoGrav.force = Vector3.new(0, script.Parent:GetMass() * 196.2, 0) script.Parent.Velocity = Vector3.new(0,0,0) end end |
|
|
| Report Abuse |
|
|
tinarg
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
| |
|
tinarg
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
| |
|
tinarg
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
| |
|
tinarg
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
| |
|
tinarg
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
| |
|
tinarg
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
| |
|
tinarg
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 4925 |
|
|
| 21 Apr 2014 07:00 PM |
| PLEASE! ANYONE! I REALLY NEED IT! |
|
|
| Report Abuse |
|
|
|
| 21 Apr 2014 07:00 PM |
Try this
if child:IsA("Part") then if not child:FindFirstChild("NoGrav") then |
|
|
| Report Abuse |
|
|
|
| 21 Apr 2014 07:02 PM |
| if child.ClassName == "Part" and child:FindFirstChild("NoGrav") == nil then |
|
|
| Report Abuse |
|
|