#Studio can't find "Button"

1 messages · Page 1 of 1 (latest)

polar relic
#

Infinite yield possible on 'Players.XxXYOSHlEXxX.PlayerGui.screenUI.Button:WaitForChild("Button")' - Studio

tranquil sphinx
#

well is there something called button inside the button

#

cus thats what the waitforchild does rn

hazy zodiac
polar relic
hazy zodiac
#

In the code you showed

polar relic
#

whats that?

hazy zodiac
polar relic
#

what should i do?

#

this is the code btw

#

local replicatedStorage = game:GetService("ReplicatedStorage")
local remotes = replicatedStorage:WaitForChild("Remotes")
local rollFunction = remotes:WaitForChild("RollFunction")

local screenUI = script.Parent
local button = screenUI:WaitForChild("Button")
local resultLabel = screenUI:WaitForChild("ResultLabel") -- new: display result in UI

local debounce = false

button.MouseButton1Click:Connect(function()
if debounce then return end
debounce = true

local aura = rollFunction:InvokeServer()
print("You got:", aura)

-- Display result in the UI
resultLabel.Text = "You got: " .. aura

wait(1)
debounce = false

end)

stiff lily
#

brother