How To Edit GUI Text From a GUI Button,

I’m trying to make it so when you hit the button, the number you get will show up in a textlabel. This is my current script.

local Switch = script.Parent
local function rollDice(): number
return math.random(1, 10)
end
local Debounce = false
Switch.MouseButton1Click:Connect(function()
if not Debounce then
local Nums = rollDice()
script.Parent.Parent.TextLabel = "Normal Roll - "…Nums
end
end)

1 Like

bro i am so sorry i didnt even see i didn’t add a text mb you can close this :skull:

lol.

I was about to reply saying that you missed .Text here:

delete the post / set your message as solution

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.