shlexware / Rayfield

Rayfield Interface Suite
Apache License 2.0
62 stars 124 forks source link

Default values aren't correct #37

Open Lncvrt opened 3 months ago

Lncvrt commented 3 months ago

When I load my script, the default values should look like: image

But they actually look like image

Code:

MovementTab:CreateSlider({
    Name = 'Speed',
    Range = {1, 25},
    Increment = 0.5,
    Suffix = 'Modifier',
    CurrentValue = 1,
    Flag = 'SpeedSlider',
    Callback = function(Value)
        player.Character.Humanoid.WalkSpeed = Value * 16
    end,
})

MovementTab:CreateSlider({
    Name = 'Jump Power Modifier',
    Range = {1, 10},
    Increment = 0.5,
    Suffix = 'Modifier',
    CurrentValue = 1,
    Flag = 'JumpPowerSlider',
    Callback = function(Value)
        player.Character.Humanoid.JumpPower = Value * 50
    end,
})

MovementTab:CreateSlider({
    Name = 'Gravity Modifier',
    Range = {-25, 25},
    Increment = 0.5,
    Suffix = 'Modifier',
    CurrentValue = 1,
    Flag = 'GravitySlider',
    Callback = function(Value)
        game.Workspace.Gravity = Value * 196.2
    end,
})
Lncvrt commented 3 months ago

Doing this won't even fix it

MovementTab:CreateSlider({
    Name = 'Speed',
    Range = {1, 25},
    Increment = 0.5,
    Suffix = 'Modifier',
    CurrentValue = 1.0,
    Flag = 'SpeedSlider',
    Callback = function(Value)
        player.Character.Humanoid.WalkSpeed = Value * 16
    end,
})

MovementTab:CreateSlider({
    Name = 'Jump Power Modifier',
    Range = {1, 10},
    Increment = 0.5,
    Suffix = 'Modifier',
    CurrentValue = 1.0,
    Flag = 'JumpPowerSlider',
    Callback = function(Value)
        player.Character.Humanoid.JumpPower = Value * 50
    end,
})

MovementTab:CreateSlider({
    Name = 'Gravity Modifier',
    Range = {-25, 25},
    Increment = 0.5,
    Suffix = 'Modifier',
    CurrentValue = 1.0,
    Flag = 'GravitySlider',
    Callback = function(Value)
        game.Workspace.Gravity = Value * 196.2
    end,
})