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

what does expected identifier got mean?

Asked by 4 years ago

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).

This is my code. | | | v local replicatedStroage = game:GetService("ReplicatedStorage") local pickKiller = replicatedStroage:WaitForChild("PickKiller") local players = game:GetService("Players") function pickkiller(people) repeat for _,playerchosen in pairs(people:GetChildren()) do local RandomNum = math.random(0,40) local TopOfTheNum = math.random(20,40) wait(0.1) if RandomNum >= TopOfTheNum then print(playerchosen.." got chosen as the killer") end end until end

0
that means Luau expected an identifier but it got something else, so give Luau an identifier where it wants it incapaz 195 — 4y

1 answer

Log in to vote
0
Answered by
raid6n 2196 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

There are many things wrong with your code.

Your code:

01local replicatedStroage = game:GetService("ReplicatedStorage") -- not needed in code
02local pickKiller = replicatedStroage:WaitForChild("PickKiller") -- not needed in code
03local players = game:GetService("Players")
04function pickkiller(people) -- what is people
05 repeat -- why are you repeating??
06    for _, playerchosen in pairs(people:GetChildren()) do -- what is people
07        local RandomNum = math.random(0, 40)
08        local TopOfTheNum = math.random(20, 40)
09        wait(0.1)
10        if RandomNum >= TopOfTheNum then
11            print(playerchosen .. " got chosen as the killer")
12        end
13    end
14    until -- until what?
15end

Edited code:

01local players = game:GetService("Players")
02function pickkiller()
03   for _, playerchosen in pairs(players:GetChildren()) do
04        local RandomNum = math.random(0, 40)
05        local TopOfTheNum = math.random(20, 40)
06        wait(0.1)
07        if RandomNum >= TopOfTheNum then
08            print(playerchosen .. " got chosen as the killer")
09        end
10    end
11end

Answering title:

Unfortunately, you did not send the full output, so I am unable to help you.

if the code works pls accept so we both get rep

0
people is a variable you put and i was trying to finish the until Trampyling 43 — 4y
0
please dont submit unfinished code raid6n 2196 — 4y
Ad

Answer this question