so im creating a turbine failure game and im detecting the velocity that the turbin is going and represent it on a panel:
Turbine:
v = 0
rev = 0
maxVel = 1
MaxSpeed = false
Levels = workspace.Level
script.Parent.Parent.On.Changed:Connect(function()
if script.Parent.Parent.On.Value == true then
while true do
script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(0,0,v)
if rev >= 1000 and MaxSpeed == true then
maxVel = 2
print('Broken')
script.Parent.Parent.MainFan.ParticleEmitter.Enabled = true
script.Parent.Parent.SecondaryFan.ParticleEmitter.Enabled = true
end
rev = rev+1
if v <= maxVel then
v = v + 0.0005
Levels.Value = v
else
MaxSpeed = true
print('MaxVel')
end
wait()
end
end
end)
Panel:
vel = workspace.Level
Levels = script.Parent.Levfel
vel.Changed:Connect(function()
print(vel.Value)
if vel.Value == 0.1 then
Levels.Value = 1
warn(1)
elseif vel.Value ==0.2 then
Levels.Value = 2
elseif vel.Value ==0.3 then
Levels.Value = 3
elseif vel.Value ==0.4 then
Levels.Value = 4
elseif vel.Value ==0.5 then
Levels.Value = 5
elseif vel.Value ==0.6 then
Levels.Value = 6
elseif vel.Value ==0.7 then
Levels.Value = 7
elseif vel.Value ==0.8 then
Levels.Value = 8
elseif vel.Value ==0.9 then
Levels.Value = 9
elseif vel.Value ==1 then
Levels.Value = 10
end
end)
but the panel script dont detect the vel.Value so how can i fix it

1 comment
Levels = script.Parent.Level isn't connected to any data. If it's the level's name, then it would be script.Parent.Level.Name , but then you would need to do some more coding to change the string to a value. Or just add a custom value into each level part.