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
01local debounce = true
02 
03script.Parent.MouseClick:Connect(function(plr)
04    if plr.Name == "roblox" or "ASMXGaming" or "lukedm" then
05        if debounce == true then
06            debounce = false
07            game.Workspace.Blackout:Play()
08            wait(6)
09            game.Workspace.Dark.Value = true
10            wait (30)
11            game.Workspace.Dark.Value = false
12            debounce = true
13        end
14    end
15end)

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
01local debounce = true
02 
03script.Parent.MouseClick:Connect(function(plr)
04    if plr.Name == "roblox" or plr.Name =="ASMXGaming" or plr.Name =="lukedm" then
05        if debounce == true then
06            debounce = false
07            game.Workspace.Blackout:Play()
08            wait(6)
09            game.Workspace.Dark.Value = true
10            wait (30)
11            game.Workspace.Dark.Value = false
12            debounce = true
13        end
14    end
15end)

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.

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

Answer this question