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

Trying to make plot bigger or smaller according to value?

Hi there. basically what i am trying to do, is make a plot bigger or smalled according to a value. Here is my script:

local museumValue = script.Parent.MuseumLevel
local plot = script.Parent
local part = script.Parent.Part


museumValue.Changed:Connect(function()
	if museumValue.Value == 1 then
		plot.Size = Vector3.new(80,1,80)
		part.Position = plot.Position + Vector3.new(-50,3,0)
	elseif museumValue == 2 then
		plot.Size = Vector3.new(100,1,100)
		part.Position = plot.Position + Vector3.new(-70,3,0)
	elseif museumValue == 3 then
		plot.Size = Vector3.new(120,1,120)
		part.Position = plot.Position + Vector3.new(-90,3,0)
	elseif museumValue == 4 then
		plot.Size = Vector3.new(140,1,140)
		part.Position = plot.Position + Vector3.new(-110,3,0)
	elseif museumValue == 5 then
		plot.Size = Vector3.new(160,1,160)
		part.Position = plot.Position + Vector3.new(-130,3,0)
	elseif museumValue == 6 then
		plot.Size = Vector3.new(180,1,180)
		part.Position = plot.Position + Vector3.new(-150,3,0)
	elseif museumValue == 7 then
		plot.Size = Vector3.new(200,1,200)
		part.Position = plot.Position + Vector3.new(-170,3,0)
	end
end)


wait(50)
museumValue.Value = 2

However, after the 50 seconds, it switches the value but nothing happends. Am i using Vector3 wrong perhaps?

Thanks for any help :)

1 answer

✓ Accepted answer

This is because you are making an if then statement on if museumValue is 2, museumValue is not a number, and the number is inside the museumValue, to fix this change all of your if then statements to

if museumValue.Value == (number) then -- instead of if museumValue == (number) then

if you found this helpful please mark my post as an answer :D

1 comment

0

Oh yeeeeaaahhh I forgot about that lol by bad Thanks for your help :)

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