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

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

Asked by 4 years 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 51
4 years 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