New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Why doesn´t the Increment Value get updated to one?

Asked by 4 months ago

I need a certain value to rise when the player presses the part. I am assigning this value through another script and it doesn´t work. The value I am talking about is the player.Hidden.Increment.Value. The script below is a server script while the script assigning the value is a local script.

script.Parent.ClickDetector.MouseClick:Connect(function(player)
    player.Hidden.Hazard.Value = player.Hidden.Hazard.Value + 1 + player.Hidden.Increment.Value 
    print(player.Hidden.Hazard.Value + player.Hidden.Increment.Value)
    script.Parent.Transparency = script.Parent.Transparency + 0.1


    if script.Parent.Transparency > 1 then
        script.Parent.ClickDetector.MaxActivationDistance = 0
        script.Parent.CanCollide = false
    end
end)

I will remember to accept a good answer.

1 answer

Log in to vote
1
Answered by
Derzett 49
4 months ago

Is the increment value set to 1? Also you should use player.Hidden.Hazard.Value + 1 * player.Hidden.Increment.Value not +. I'm sure this would work fine!

Ad

Answer this question