I keep getting this error but I can see that everything is there properly. Here is some photos:
Post your script please. It’s probably to do with how you’re referencing the model.
local car = script.Parent.Parent.Car.Value
local _Tune = require(car[“A-Chassis Tune”])
local FE = workspace.FilteringEnabled
local handler = car:WaitForChild(“ActiveAero_FE”)
local c = .1001
local Mode=0
local SpoilerPerc
local BrakePerc
local pSPerc=SpoilerPerc
local pBPerc=BrakePerc
local SPup=false
local dySpeed = 200
c = c*_Tune.WeightScaling
car.DriveSeat.ChildRemoved:connect(function(child)
for i,v in pairs(car.Misc.Downforce:GetChildren()) do
v.Force = Vector3.new()
end
end)
function Downforce()
local sp = script.Parent.Parent.Values.Velocity.Value.Magnitude
local BrakePerc = script.Parent.Parent.Values.Brake.Value
if sp>=200 then
dySpeed = 150
elseif sp<=150 then
dySpeed = 200
end
if sp>120 then
SPup=true
elseif sp<60 then
SPup=false
end
if (SPup and Mode~=2) or Mode == 1 then
if sp>200 and Mode == 0 and BrakePerc <= .3 then
SpoilerPerc=.7
else
SpoilerPerc=1
end
else
SpoilerPerc=0
end
BrakePerc = math.ceil(BrakePerc)*SpoilerPerc
if SpoilerPerc~=pSPerc or BrakePerc~=pBPerc then
if FE then
car.Misc.Spoiler.A1.W.DesiredAngle=-math.pi*SpoilerPerc/2
car.Misc.Spoiler.A2.W.DesiredAngle=math.pi*SpoilerPerc
car.Misc.Spoiler.A3.W.DesiredAngle=-math.pi*SpoilerPerc/2
car.Misc.Spoiler.A3.P.DesiredAngle=-math.pi*SpoilerPerc/2
car.Misc.Spoiler.A4.W.DesiredAngle=-math.rad(25)*BrakePerc
car.Misc.Spoiler.B1.W.DesiredAngle=math.rad(25)*BrakePerc
else
handler:FireServer("UpdateAA",SpoilerPerc,BrakePerc)
end
pSPerc=SpoilerPerc
pBPerc=BrakePerc
end
end
script.Parent.MouseButton1Click:connect(function()
if Mode==2 then
Mode=0
else
Mode=Mode+1
end
if Mode==0 then
script.Parent.Text=“Aero: Dynamic”
elseif Mode==1 then
script.Parent.Text=“Aero: Always On”
elseif Mode==2 then
script.Parent.Text=“Aero: Off”
end
end)
script.Parent.Parent.Values.Velocity.Changed:connect(function()
Downforce()
local sp = script.Parent.Parent.Values.Velocity.Value.Magnitude
local sPerc = car.Misc.Spoiler.A1.W.CurrentAngle/-math.pi
local bPerc = car.Misc.Spoiler.B1.W.CurrentAngle/math.rad(25)
car.Misc.Downforce.Body.Force = Vector3.new(0, c*-sp^2, c*-sp^22)
car.Misc.Downforce.Splitter.Force = Vector3.new(0, c-sp^2, 0)
car.Misc.Downforce.Diffuser.Force = Vector3.new(0, c*-sp^2, 0)
car.Misc.Downforce.Spoiler.Force = Vector3.new(0, c*-sp^2sPerc^2, -csp^2*(1.3+bPerc*2.7)*sPerc^2)
end)
You didn’t reference the model that’s throwing the error in that script. Are you sure that’s the script the error is coming from?
It’s the only script attached to the model.
Could you try print(car.Name) at lines 23 and 51?
it reads the name of the model
Does it print that both times? If so could you also print(car:FindFirstChild(“Misc”)) at the same places?
It only prints once, and doesn’t print the find first child line
Could you upload a file of the model in question?
It seems like the script doesn’t match the model. A lot of the variables either reference something that doesn’t exist, or reference something that does exist but in the wrong place. In terms of that error you can make it disappear by changing the car variable to:
local car = script.Parent.Parent
I got a problem still, it now it stays unanchored. I’ve tried messing about with collisions and a stay anchored script won’t do anything. What can I do next? I’m sure you seen this happen?
I’m not sure what you mean. With the edits applied the vehicle works fine. The only errors thrown are to do with the issues I highlighted.
Ok, could you send in your model? I’m getting an anchoring error you might not be getting.
EDIT: Here is a video of it happening:
I’m not sure what’s happening, if you can’t do anymore that’s fine. Thanks for the help
That’s going to have something to do with the welds on the wing. They are unanchored because they are welded, or should be welded. That’s going to be an issue either with a weld script, or the lack of welds in studio.
I found the issue. Thanks for helping me resolve this problem, it helped a lot.