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

Why wont this work?

Asked by
0ea 0
10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
01admin = coroutine.create(function()
02admins = {"Player1"}
03game.Players.PlayerAdded:connect(function(lemon)
04wait(3)
05if admins[lemon.Name] then
06print("test")
07end
08end)
09end)
10coroutine.resume(admin)
0
put the script in lua block ._. davness 376 — 10y
0
Just help 0ea 0 — 10y
0
there 0ea 0 — 10y
0
You need to explain exactly what is wrong please, or else it becomes difficult for us to narrow down the problem!!! dragonkeeper467 453 — 10y

1 answer

Log in to vote
1
Answered by 10 years ago

I believe your script is overcomplicated. Here is an alternative:

01admin = nil
02admins = {"user1", "user2"}
03 
04game.Players.PlayerAdded:connect(function(lemon)
05    for key, value in pairs(admins) do
06        if lemon.Name = value then
07            print("Hello World!")
08        end
09 
10    end
11end)

If this doesn't work, sorry. Use as much of it as you can. If it does in fact work, let me know!

Ad

Answer this question