So what is happening is when i click the invisible part the gui shows up and once you get the code wrong, it turns invisible but when you try to click it again it doesn’t go visible again.
[Local Script] (inside the textbox)
script.Parent.FocusLost:Connect(function(enterPressed)
local code = script.Parent.Text:lower()
if enterPressed and code == "copper" then
script.Parent.TextColor3 = Color3.new(0.34902, 1, 0)
script.Parent.Text = "Access Granted"
script.Parent.TextEditable = false
wait(2)
script.Parent.Parent.Visible = false
script.Parent.TextColor3 = Color3.new(0,0,0)
script.Parent.Text = ""
script.Parent.TextEditable = true
end
if enterPressed and code ~= "copper" then
script.Parent.TextColor3 = Color3.new(1, 0, 0.0156863)
script.Parent.Text = "Access Denied"
script.Parent.TextEditable = false
wait(2)
script.Parent.Parent.Visible = false
script.Parent.TextColor3 = Color3.new(0,0,0)
script.Parent.Text = ""
script.Parent.TextEditable = true
end
end)
Well, I’m not too sure what the problem here is but I think that since the ClickDetector script is unnecessarily in a Script and not a LocalScript, and that the TextBox’s script is a LocalScript, that the property will not replicate. Change the Script by the ClickDetector to be a LocalScript. You should place it in ReplicatedFirst.
when i make it into a local script and put it into replicatedfirst it says invisiblepart is not a valid member of workspace and when i put it into replicated storage, there are no errors but when i click the part nothing happens
Hm. I’m quite confused on what you just said, but I have a limited amount of posts every day so I’ll try to make this one long enough to also understand.
Me neither.
Ok, how does this relate to the topic?
I’m assuming you listen to FocusLost.
But this is not what I’m talking about. I’m talking about the “Server Script inside the invisible part”. You convert it to local and, since it doesn’t need anything outside of the current player, it shouldn’t matter to place the code in a LocalScript, but you must add a wait(2) statement, manually place the path out instead of script.Parent, and finally, place it in ReplicatedFirst or something in StarterPlayer. You can also place it in StarterPack but I don’t recommend that, since the script will reset every time the player dies.
[spoiler]Coming back to the event thing, I believe that works. Good job on coding that (wherever it is since it’s not listed).[/spoiler]
bro are you seriously mad that i said your wrong so wrote a whole paragraph? im doing it my own way because i don’t userstand you nor need your help also why do you have a limited amout of posts? its not like your famous or something
I didn’t write a paragraph, and I’m not mad, I am just a little confused on why my previous post didn’t work for you, because you didn’t provide many useful details that I could understand.
[spoiler] Alright, it might’ve seemed like a paragraph, but that’s just because of all the quotes from your text I made.
[/spoiler]
So, since I answer people’s questions, I’ll put it simply.
Ok, this is because the Client (the LocalScript) loads faster than the InvisiblePart that you made. So here’s your assumed LocalScript:
Well I don’t know what to say. Clearly something I haven’t researched. Tested it on PC and Mobile it seems to work well on both. It’s tight and it’s working … If you look at the Frame when active on the screen it’s says it’s not visible.
Hello there, I don’t know if you already got a variable for FocusLost, but something is missing.
For example if ‘FocusLost’ Is an event, then you should type: