Value not changing

Why is the value not changing?

script.Parent.power.Value = math.random(25,80)
1 Like

Any errors? What other code do you have?

no, im not getting any errors this is my code

	for i, v in pairs(ArmorModule.rarities) do
		if table.find(ArmorModule.armors["Legendary"], newRandomArmor) then
			script.Parent.power.Value = math.random(25,80)
			newTemplate2.VP.BackgroundColor3 = Color3.fromRGB(153, 134, 13)
			newTemplate.VP.BackgroundColor3 = Color3.fromRGB(153, 134, 13)
			newTemplate.VP.BorderColor3 = Color3.fromRGB(255, 171, 32)

Add a print and see if the code gets to that line. Also is the value a IntValue?

nvm its a stringval

Oh right! I assume this is being done on the server as well. If it still doesn’t work add a print after the table.find.

Hello, how are you doing?

If it’s a string value, try this:

script.Parent.power.Value = tostring(math.random(25,80))

Make sure it’s on a server script though, have a good day!

Oh nvm i fixed the problem i made a new script inside of the values and changed it from there, thanks for helping, Sorry to waste your time

1 Like

perhaps if you put it in a while loop?

That’d work if he wants it to keep changing the values constantly.
If it was a single time, the while loop wouldn’t be needed.
You’re late though, he already found the solution for his problem. Sorry mate.