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

I am making a door control GUI. But i keep running into errors with the button. Can someone help me?

Asked by 5 years ago

So i am pretty new to lua coding but have a basic understanding of how it works. I am trying to make a gui that moves a door. The first frame is a login screen that checks if the person using it matches my username. But it wont get past the first frame. Here is the code

   -- Variables --

permission = {"sidneymnl"}

button = script.Parent



-- Main Script --

function Check(name)

for i = 1,#permission do

if (string.upper(name) == string.upper(permission[i])) then return true end

end

return false

end



function onClicked(click)

local human = click.Parent:findFirstChild("Humanoid")

if (human ~= nil ) then

if (Check(human.Parent.Name)) then

script.Parent.Parent.Visible = false

script.Parent.Parent.Parent.Second.Visible = true

end

end

end



button.MouseButton1Click:connect(onClicked)

And here is the model https://www.dropbox.com/s/kt1iv098yty3rpn/Door%20test.rbxm?dl=0 If anyone can help me fix it i would be happy. P.S The second frame does work its just the first one that wont work

~Sidney

Answer this question