Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why isnt my surface GUI script working with me?

I have NO idea why my script doesn't work. It doesn't tell me errors, I ran checks through multiple methods, none work. Prints won't even go. help pls

I am trying to tween my guis in a certain spot when a certain check is true. Won't work.

game.Workspace.Tutorial.TvScreen.SurfaceGui.CoverScreen.BlackBackground:WaitForChild("Intro")
local plr = game.Players.LocalPlayer

--For tweening

--yes/not
--Yes. Starting Point: {0, 0},{0.25, 0} ending: {0.2, 0},{0.25, 0}
--No. Starting Point: {0.75, 0},{0.25, 0} ending: {0.6, 0},{0.25, 0}
active = true
print('1') -- won't print

if active == true then
	print('2') -- won't print
	local Yes = script.Parent["Yes/No"].Yes
	local No = script.Parent["Yes/No"].No
	for i = 0, 1, 0.1 do
		Yes.BackgroundTransparency = i
		No.BackgroundTransparency = i				
		Yes.TextTransparency = i
		No.TextTransparency = i
		wait(0.1)
	end
	print('3')-- won't print
	Yes:TweenPosition(UDim2.new(0, 0, 0.25, 0) 'In', 'Linear', 1, false)
	wait(0.1)
	Yes:TweenPosition(UDim2.new(0.2, 0, 0.25, 0) 'In', 'Linear', 1, false)
	wait(0.1)
	No:TweenPosition(UDim2.new(0, 0, 0.25, 0) 'In', 'Linear', 1, false)
	wait(0.1)
	No:TweenPosition(UDim2.new(0.75, 0, 0.25, 0) 'In', 'Linear', 1, false)
end

5 comments

0

Have you checked the Output for any errors or feedback? :o

0

Where is the script located give me a specific place... like game.Workspace.Script or game.ReplicatedStorage.Script or what? Also, is the script is a local script or server script?

0

Line #1, make sure you didn't misspell anything. WaitForChild doesn't print anything to the output simply because it's waiting for the child. Also, make sure you check your hierarchy!

0

My hierarchy is fine.

0

@Has My hierarchy is fine. @King game.Workspace.Tutorial.TVScreen.SurfaceGui.CoverScreen.LocalScript. @The No

1 answer

✓ Accepted answer

You have to clone the SurfaceGUI into the player's PlayerGui, then set the Adornee to the part that you want the SurfaceGUI on.

local plr = game.Players.LocalPlayer
local gui = game.Workspace.Tutorial.TvScreen.SurfaceGui:Clone()
gui.Adornee = game.Workspace.Tutorial.TvScreen
gui.Parent = plr.PlayerGui

--continue

1 comment

0

doesn't work. Nothing in output

This discussion is preserved as it was. New answers, comments, and votes are closed.