#error

1 messages · Page 1 of 1 (latest)

edgy seal
#
local rep = game:GetService("ReplicatedStorage")
local teams = game:GetService("Teams")
local players = game:GetService("Players")

local roundstart = false

function assignteam()
    local allplr = players:GetPlayers()
    
    local killerteam = teams.Killer
    local survivorteam = teams.Survivors
    
    for _,plr in pairs(allplr) do
        plr.Neutral = false
        plr.Team = survivorteam
    end
    
    --[[if #allplr >=2 then
        local killerindex = math.random(1,#allplr)
        local killerplr = allplr[killerindex]
        killerplr.Neutral = false
        killerplr.Team = killerteam
    end  ]]
end

function startround()
    if roundstart == true then return end
    while #players:GetPlayers() <= 1 do
        print("Waiting for more players...")
        task.wait(1)
    end
    if roundstart == false then
        roundstart = true
        print("Round started")
    end
    
    local allplr = players:GetPlayers()
    for i = 10,1,-1 do
        task.wait(1)
        print("INTERMISSION TIME- "..i)
    end
    
    assignteam()
    gamestartandends()
end

function gamestartandends ()
    while #players:GetPlayers() <= 1 do
        print("Waiting for more players...")
        task.wait(1)
    end
    for i = 20,1,-1 do
        task.wait(1)
        print("GAME ENDS IN- "..i)
    end
    roundstart = false
    print("GAME ENDED NEW STARTING")
    
    task.wait(1)
    startround()
end
startround()
#

@grave gate sorry for ping

#

in here i am getting error

#

like all player are getting on killer team

#

and on player 1 pov all are on survivor

#

while on player 2 pov all are on killer

#

and on player 3 pov he is only survivor

formal hemlock
edgy seal
formal hemlock
#

that makes no sense

#

whats pov

#

point of view?

edgy seal
#

yea

edgy seal
#

nope

#

a script on server script

formal hemlock
#

idk when i run the code everyone just goes on the survivors team

#

your teams auto assignable?

edgy seal
#

yea

#

nope

#

not auto assign

#

@blissful wind

#

idk whats the error

#

i did every thing correct

formal hemlock
#

im not getting that issue you must be assigning teams somewhere else in the code

edgy seal
#

like um?

blissful wind
#

What’s ur error can u explain more

formal hemlock
#

its more of a bug

blissful wind
#

I can give a planning sheet

#

To rewrite if u want

formal hemlock
#

i think hes saying that the clients teams dont match for each client

edgy seal
edgy seal
edgy seal
#

like 3 killers

#

when there should be one

#

😭 😭

blissful wind
#
Use runservice heartbeat for timers since it’s more accurate and easier to cancel/manage in general

Before u assign neutral team first select a random player to be killer then loop through all players in game and if they’re not the killer then assign their team to neutral

When the round ends set people in the neutral and killers team to wtv ur default team is

And also use a module for this if u want it more manageable and u cant take a step further and use oop
edgy seal
#

hm

formal hemlock
#

is this really the level s1s are on?

blissful wind
formal hemlock
#

how did he get s1

edgy seal
#

i am coding after 5 months

#

understand plz 💔

formal hemlock
grave gate