I'm just trying a simple TickTacToe thing, so I've decided to use surfaceGui's to visually mark the X's and O's. Problem is, no matter what I do in this code, it for whatever reason does not seem to affect the game.

local CreateGUI = function(XorO)
	local SurfaceGUI = Instance.new("SurfaceGui",script.Parent)
	local TextLabel = Instance.new("TextLabel", SurfaceGUI)
	--TextLabel.BackgroundColor3 = Color3.new(163, 162, 165)
	TextLabel.BackgroundTransparency = 1
	TextLabel.Size = UDim2.new({0, 200},{0, 200})
	TextLabel.RichText = true
	TextLabel.TextScaled = true 
	TextLabel.Text = "XorO"
end

ClickDetector.MouseClick:Connect(function(plr)
	local WhoOwns = Instance.new("BoolValue",script.Parent)
	WhoOwns.Name = "WhoOwns"
	if Turn.Value == true then
		--Place X
		print(X)
		WhoOwns.Value = true
		Turn.Value = false 
		CreateGUI("X")
	else
		--Place 0 
		print(O)
		WhoOwns.Value = false
		Turn.Value = true 
		CreateGUI("O")
	end
	
	ClickDetector:Destroy()
end)

(all in a server script)

For whatever reason, although the surfaceGui shows up in the explorer, it does not visually show up at all in the game.

3 comments

1

Did you make sure you were adding it to the correct face?

0

Yup, im sure

0

Oh, just checked, thats the problem, thanks.