My script is not resizing my GUI in Roblox (not studio)? (Title is hating me a lot today)

playerp = script.Parent.Parent.Parent.Parent.Parent.Parent.name
player = game.Workspace:WaitForChild(playerp)
dirt = player:WaitForChild("DirtEaten")
while player.Humanoid.Health ~= 0 do
	if dirt.Value >= 101 then
		dirt.Value = 100
		script.Parent.Size = UDim2.new(1, 0, 1, 0)
	else
		script.Parent.Size = UDim2.new((dirt.Value / 100), 0, 1, 0)
	end
	wait()
	dirt = player:WaitForChild("DirtEaten") 
	if dirt.Value <= 0 then
		player.Humanoid.Health = player.Humanoid.Health - 5
		dirt.Value = dirt.Value + 1
	end
end

This script is meant to take a value and then resize the GUI depending on that value but it is not working! Please help!

PS: The value is stuck at 123

1 comment

0

Titles are a pain