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

Not retrieving values upon new click?

Asked by
xg1y 41
5 years ago

Howdy, so I'm attempting to display the current progress of construction, but the problem is that if I create a construction, select a planet without ongoing construction, it causes the script to idk spazz out ? this is what occurs currently; https://gyazo.com/4ca972223eff6c19ee489df0bfbc90dd

Script being; (No errors appearing except the occasional;

Infinite yield possible on 'Workspace.Planets:WaitForChild(-PlanetName-)'

local planetname
local planet
local mouse = game.Players.LocalPlayer:GetMouse()

mouse.Button1Down:Connect(function()
    planetname = script.Parent.Parent.PlanetFrame.One.PlanetName.Text
    planet = game.Workspace.Planets:WaitForChild(planetname)
    planet.Progress.Changed:Connect(function()
        script.Parent.Parent.PlanetFrame.Two.Bar.Progress.Size = UDim2.new(planet.Progress.Value/100, 0, 1, 0)
    end)
end)

Cheers for any help.

0
Use FindFirstChild() and see if it makes any diffference. DeceptiveCaster 3761 — 5y
0
Not wroking xg1y 41 — 5y
0
working* xg1y 41 — 5y

Answer this question