Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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!

This discussion is preserved as it was. New answers, comments, and votes are closed.