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

Frame size not updating?

I have this local script inside of a frame that is just supposed to change the size of the frame. But the size isn't updating to the value I want it to when I test it out. When I run the command:

game.Players.jediplocoon.PlayerGui.Level.XPBar.Size = UDim2.new(0, 200, 0, 30)

in the output/console it works just fine, but it doesn't work for some reason in my script, here it is:

local barsize = script.Parent.Size
while true do
	barsize  = UDim2.new(0, 200, 0, 30)
	print(barsize) --prints {0, 200},{0, 30}
	wait(1)	
end

Note-This is in a local script in a frame, which I'm trying to change the size of. If anybody could tell me what I did wrong, and point me in the right direction that would be greatly appreciated.

3 comments

0

Instead of using game.Players.[Player], use game.Players.LocalPlayer. Also, please don't resize guis using pixels.

0

I'm pretty new to scripting in roblox, how would I resize it without using pixels?

0

nvm, i just looked it up

1 answer

✓ Accepted answer

For some reason, i don't know why it's not working, but i have the solution and i tested here on studio.

****This is the second script.

local bar = script.Parent
	while true do
	    bar.Size = UDim2.new(0, 200, 0, 30)
	    print(bar.Size) 
	    wait(1)
	end

Hope this helps.

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