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

Why is my UDim2 not working? I'm doing a progressbar for strength in my game.

local StregnthProgress = game.StarterGui.AbilitysGui.AbilitysFrame.StrengthFrame.Loadingbar.Progress
local clickdetector = script.Parent:WaitForChild("ClickDetector")

clickdetector.MouseClick:Connect(function()
	StregnthProgress.Size = UDim2.new(0,250,0,18)
end)

1 answer

✓ Accepted answer

Hello, found the problem. It's because you're trying to change the UI frame in the startergui which the user can't see cause they have a playergui already here's a fix tho:

local clickdetector = script.Parent:WaitForChild("ClickDetector")

clickdetector.MouseClick:Connect(function(player)
   	local StregnthProgress = game:GetService("Players")[player.Name].PlayerGui.AbilitysGui.AbilitysFrame.StrengthFrame.Loadingbar.Progress
	StregnthProgress.Size = UDim2.new(0,250,0,18)
end)

if worked please accept, thank you

2 comments

0

Thank you it worked!

0

No worries, glad to help :D

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