#random error??

1 messages · Page 1 of 1 (latest)

lucid apex
#
local char = player.Character
local textlabel = script.Parent
local timer = 3
local red = workspace.red1
local blue = workspace.red2
local green = workspace.red3
local yellow = workspace.red4
local deletedparts = 0
textlabel.Text = "gaem starts in: " .. timer

task.spawn(function()
    while timer > 0 do
        task.wait(1)
        timer -= 1
        textlabel.Text = "gaem starts in: " .. timer
        if timer == 0 then
            textlabel.Text = "gaem is starting!!!11111!!!!"
            task.wait(2)
            game.ReplicatedStorage.GameStarting:FireServer(timer)
            task.wait(1)
            while true do
                local random = math.random(1, 4)
                if random == 1 then
                    red.Parent = game.ReplicatedStorage
                    deletedparts = deletedparts+1
                elseif random == 2 then
                    blue.Parent = game.ReplicatedStorage
                    deletedparts = deletedparts+1
                elseif random == 3 then
                    green.Parent = game.ReplicatedStorage
                    deletedparts = deletedparts+1
                elseif random == 4 then
                    yellow.Parent = game.ReplicatedStorage
                    deletedparts = deletedparts+1
                    task.wait(2)
                end
                if deletedparts == 4 then
                    deletedparts = 3
                    if random == 1 then
                        red.Parent = workspace
                    elseif random == 2 then
                        blue.Parent = workspace
                    elseif random == 3 then
                        green.Parent = workspace
                    elseif random == 4 then
                        yellow.Parent = workspace
                end
            end
        end
    end
end)```
the closing bracket at the end, its fucking saying 'expected idenitfier, got ')''
verbal bough
#

You are missing a 'end'

lucid apex
#

where

plucky helm
#

missing an end

lucid apex
#

missing or extra

#

???

verbal bough
#

missing

dusty ether
#

you need an end at the deleted parts section

#

the if inside the deleted parts

#

doesnt have an end to it

hollow dust
#

wtf i thought it was extra end 😭

plucky helm
#

indentation helps lua if deletedparts == 4 then deletedparts = 3 if random == 1 then red.Parent = workspace elseif random == 2 then blue.Parent = workspace elseif random == 3 then green.Parent = workspace elseif random == 4 then yellow.Parent = workspace end

dusty ether
verbal bough
#

also use lua syntax highlitghting please

dusty ether
reef stirrup
#

I want to make a game /:

hollow dust
lucid apex
#

ok

#

i added it

#

thx yall!!!!

dusty ether
#

np

#

dont forget to mark this solved

lucid apex
#

marked it as solved

#

!!!!!