How to refrence things from workspace in a local script (Solved)

How can I refrence things from a local script in my gui?

local Text = script.Parent
local tweenservice = game:GetService("TweenService")
local detector = game.Workspace.Button.ClickDetector <---- the issue
local tsinfo = TweenInfo.new(
	2,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	0,
	false
)

local tween = tweenservice:Create(Text, tsinfo, {TextTransparency = 1})

if not game:IsLoaded() then
	game.Loaded:Wait()
end
wait(8)
tween:Play()  
tween.Completed:Connect(function()
	Text.Visible = false
	Text.TextTransparency = 0
end)
detector.MouseClick:Connect(function()
	tween:Play()
	Text.Text = "Objective: Find the exit"
end)

image

1 Like

same as how you would in a server script although maybe use a waitforchild instead as the script could load before the object does

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