Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

what does expected identifier got mean?

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

1 comment

0

that means Luau expected an identifier but it got something else, so give Luau an identifier where it wants it

1 answer

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

2 comments

0

people is a variable you put and i was trying to finish the until

0

please dont submit unfinished code

This discussion is preserved as it was. New answers, comments, and votes are closed.