Error with door number script

Hello! I’m trying to make a game like doors and can’t make numbers on the doors. This is the module script to generate the rooms and as you can see I’ve added a surface GUI and textlabel.

local room = {}
room.random = Random.new()
local roomtext = Instance.new("SurfaceGui")
local texttext = Instance.new("TextLabel")
texttext.Parent = roomtext
texttext.TextScaled = true
texttext.TextSize = 62
texttext.Size = UDim2.new(1,0,1,0)
texttext.BackgroundTransparency = 1
texttext.BorderSizePixel = 0
local roomnumber = 1
function room.Generate(prevRoom)
	local possibleRooms = workspace.Rooms:GetChildren()
	local randomRoom = possibleRooms[room.random:NextInteger(1, #possibleRooms)]
	local newRoom = randomRoom:Clone()
	newRoom.Entrance.Transparency = 1
	newRoom.Exit.Transparency = 1
	newRoom.PrimaryPart = newRoom.Entrance
	newRoom:PivotTo(prevRoom.Exit.CFrame)
	roomtext.Parent = prevRoom.Exit
	newRoom.Parent = workspace.GeneratedRooms
	roomnumber = roomnumber + 1
	texttext.Text = roomnumber
	print(roomnumber)
	return newRoom
end

return room

Any help would be appreciated :slight_smile:

1 Like

You probably need to change the size of the SurfaceGui

1 Like

yeah i think you need to change the size of the surfacegui

1 Like