Hello. This script is for a player only game that is under development. Instead of a password GUI, I want it to just let me and my friend in. Thanks for helping.
Pass= script.Parent.Parent.Parent.Passcode function Clicked() for i=1, 10 do wait(0.1) script.Parent.ImageTransparency = script.Parent.ImageTransparency +0.1 end --after this i want this to check if the person who clicked is either the user "123thatalt" or "mendez3581" or "Player1" wait(0.3) script.Parent.Parent.Visible = false for b=1,30 do wait(0.001) Pass.Position = Pass.Position + UDim2.new(0, 7, 0, 0) end end script.Parent.MouseButton1Down:connect(Clicked)
Make this a LocalScript, and try with this code:
Pass= script.Parent.Parent.Parent.Passcode allowed = {player1 = true, mendez3581 = true, ["123thatalt"] = true} function Clicked() for i=1, 10 do wait(0.1) script.Parent.ImageTransparency = script.Parent.ImageTransparency +0.1 end if not allowed[Game.Players.LocalPlayer.Name:lower()] then return end --function will exit if not in the 'allowed' dictionary above. wait(0.3) script.Parent.Parent.Visible = false for b=1,30 do wait(0.001) Pass.Position = Pass.Position + UDim2.new(0, 7, 0, 0) end end script.Parent.MouseButton1Down:connect(Clicked)
This should be inside Localscript,Starterpack.
Player = game.Players.LocalPlayer if Player.Name == "YOURNAMEHERE" or "YOURFRIENDSNAMEHERE" then script:remove() else Player:remove() end
Hope it helped :P