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

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

Asked by
bt6k 23
4 years ago
Edited 4 years ago
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
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 d1_rek 46 — 4y

2 answers

Log in to vote
2
Answered by
IcyMizu 122
4 years ago
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

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 SethHeinzman 284 — 4y
Ad
Log in to vote
2
Answered by 4 years ago

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

Answer this question