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

Works in studio but not in game?

This is in a localscript and it works fine in studio but not in the game. Help?

local access =  script.Parent.Parent.Access

script.Parent.FocusLost:connect(function()
    if script.Parent.Text == "Roblox" then 
      access.Text = "Access Granted"
	  access.TextColor3 = Color3.new(0, 255, 0)
    end
end)

Thanks

1 answer

✓ Accepted answer

To make this more efficient, and after looking how this is setup, I've made a end result of a working script that will do just the job.

LocalScript in the MainFrame

local frame = script.Parent
local words = frame.Welcome
local player = frame.Parent.Parent.Parent
local access = script.Parent.Access
local box = script.Parent.TextBox

words.Text = "Welcome to the multiverse, " ..player.Name

box.FocusLost:connect(function()
		if box.Text == "Roblox" then
			access.Text = "Access Granted"
			access.TextColor3 = Color3.new(0,255,0)
		end
end)

Have a wonderful day! :)

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