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

Can you please help with my survival horror game?

Asked by
niroqeo 123
4 years ago

So I'm making a survival horror game and I need it so it can somehow know if a player has escaped to a player being killed. The script checking if there are no players in a team is below. Please help!

if #teamplayers == 0 then
    for _, v in pairs(game.Players:GetChildren()) do
        if v.TeamColor == BrickColor.new("Carnation pink") then
            v.leaderstats.Cash.Value = v.leaderstats.Cash.Value + 100
            v.CharacterAppearanceId = v.UserId
            v.TeamColor = BrickColor.new("White")
            v.CharacterAppearanceId = v.UserId
            print("eeeee")
            game.ReplicatedStorage.ESallyhasWon:FireAllClients()
            wait(3)

            script.CountDown.Value = 0
        end
    end
end
0
any output errors? Lunaify 66 — 4y
0
There's nothing wrong with the script. I just need ideas on how it would work. What I mean is I need the script to somehow know between a player dying and a player escaping. niroqeo 123 — 4y
0
So if you're wanting to separate players in any way, I'd would either use a set of tables to store the different playerstates or use CollectionService to tag players. ForeverBrown 356 — 4y
0
Thanks! I'll definitely try using tables. niroqeo 123 — 4y
View all comments (2 more)
0
Well, is it possible for tables to be in modulescripts so multiple scripts can access it? niroqeo 123 — 4y
0
Maybe you could make a title related to the script, not the game though. Dylan011444 59 — 4y

Answer this question