Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Number Value not detected?

Asked by 3 years ago

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

0
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. thedubsgaming 22 — 3y

2 answers

Log in to vote
0
Answered by
Cirillix 110
3 years ago

I don't know why you don't put the value in replicated storage, but you should. Anyways, your mistake is pretty simple, you made a spelling mistake at line 2 on the panel script.

0
so i changed that, it still dont work fsadsafdsfsf 15 — 3y
0
and i moved the values to replicated storage and it dosnt work :( fsadsafdsfsf 15 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

Guys i solve it

Answer this question