#Studio can't find "Button"
1 messages · Page 1 of 1 (latest)
well is there something called button inside the button
cus thats what the waitforchild does rn
'Players.XxXYOSHlEXxX.PlayerGui.screenUI.Button:WaitForChild("Button")
To
Players.XxXYOSHlEXxX.PlayerGui.screenUI:WaitForChild("Button")```
You're searching for a button inside of the button you want, common but painful thing
this is all the things inside starterGUI
You're basically doing ScreeUI.button.button
In the code you showed
whats that?
Your code is searching for the button you want inside of that button, you misstyped it
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)
brother