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

How do I fix this player finder?

Line 12 needs to find if the player is either 123thatAlt, Mendez3581, or Player1. Please help me by fixing my error in the script. There is no output from this script.

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
	script.Parent.Parent.Visible = false
	wait(0.3)
	
	if script.Parent.Parent.Parent.Parent.Parent.Parent.Name == {"Player1","Mendez3581","123thatAlt"} then
		for b=1,30 do
		wait(0.001)
	    Pass.Position = Pass.Position + UDim2.new(0, 7, 0, 0)
		end
	
	end
	end
	
script.Parent.MouseButton1Down:connect(Clicked)

1 answer

You should setup a table at the top of your file, then check if the value is valid.

local guiOwner = script.Parent.Parent.Parent.Parent.Parent.Parent local allowedPlayers = {"Player1", "Mendez3581", "123thatAlt"}

then, at line 12, you add:

for _,plyr in ipairs(allowedPlayers) do
	if guiOwner.Name == plyr.Name then
		-- DO STUFF
	end
end

3 comments

0

Im confused. What line do I add if it isn't a local script?

0

I added both the lines but still doesn't do what I want it to do.

0

is there an error, or anyone can still click the button?

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