Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Works in studio but not in game?

Asked by 8 years ago

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

Log in to vote
1
Answered by
legosweat 334 Moderation Voter
8 years ago

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! :)

Ad

Answer this question