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 3 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 — 3y

1 answer

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

There are many things wrong with your code.

Your code:

local replicatedStroage = game:GetService("ReplicatedStorage") -- not needed in code
local pickKiller = replicatedStroage:WaitForChild("PickKiller") -- not needed in code
local players = game:GetService("Players")
function pickkiller(people) -- what is people
 repeat -- why are you repeating??
    for _, playerchosen in pairs(people:GetChildren()) do -- what is people
        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 -- until what?
end

Edited code:

local players = game:GetService("Players")
function pickkiller() 
   for _, playerchosen in pairs(players: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
end

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 — 3y
0
please dont submit unfinished code raid6n 2196 — 3y
Ad

Answer this question