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

Why is it still doing it even though I do not have my name in there?

local debounce = true

script.Parent.MouseClick:Connect(function(plr)
	if plr.Name == "roblox" or "ASMXGaming" or "lukedm" then
		if debounce == true then
			debounce = false
			game.Workspace.Blackout:Play()
			wait(6)
			game.Workspace.Dark.Value = true
			wait (30)
			game.Workspace.Dark.Value = false
			debounce = true
		end
	end
end)

so my username is bt6k, and it is not on the list, yet it is still doing it..

Any solutions? Am I doing the plr variable wrong?

1 comment

1

Yes, if it is mouseclick it would be mouse, not player. I believe the solution would require linking script.Parent until you reach the player. Ex. script > Button > Frame > Gui > PlayerGui Folder > Player

2 answers

✓ Accepted answer
local debounce = true

script.Parent.MouseClick:Connect(function(plr)
    if plr.Name == "roblox" or plr.Name =="ASMXGaming" or plr.Name =="lukedm" then
        if debounce == true then
            debounce = false
            game.Workspace.Blackout:Play()
            wait(6)
            game.Workspace.Dark.Value = true
            wait (30)
            game.Workspace.Dark.Value = false
            debounce = true
        end
    end
end)

pretty sure u still have to do plr.Name == every or cause now u just checking if its a string i guess im not sure myself sorry

1 comment

0

Yeah what's happening is it says "does the strings exist?" on the ones without "plr.Name == " and it's like yeah so lets do the stuff inside then

You have to define the variable each time.

Line 4 should look like this.

if plr.Name == "roblox" or plr.Name == "ASMXGaming" or plr.Name == "lukedm" then

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