Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
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

Log in to vote
0
Answered by
VitroxVox 884 Moderation Voter
4 years ago

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

0
Thank you it worked! Blixtcraft 16 — 4y
0
No worries, glad to help :D VitroxVox 884 — 4y
Ad

Answer this question