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

Why does the murderer choosing script not working?

Asked by 1 year ago

Help, my murderer choosing script doesnt work:

local Players = game:GetService("Players")
local timer = script.Parent.Current
local Max = script.Parent.Max
local sound = game.Workspace.RoundStart
local chosenJack = game.ServerStorage.ChosenJack
local amountOfPlayers
local Message = Instance.new("Message")
Message.Parent = workspace
local weapon = game.ServerStorage.PumpkinAxe

while true do
    wait(1)
    updateplayeramount()
    wait(2)
    if amountOfPlayers == 1 or 2 then 
        script.Parent.Text = "You need atleast 3 people to start the round."
    else
        script.Parent.Text = "Game starting in 5"
        wait(1)
        script.Parent.Text = "Game starting in 4"
        wait(0.1)
        script.Parent.Text = "the one piece is real"
        wait(0.1)
        script.Parent.Text = "Game starting in 4"
        wait(0.8)
        script.Parent.Text = "Game starting in 3"
        wait(1)
        script.Parent.Text = "Game starting in 2"
        wait(1)
        script.Parent.Text = "Game starting in 1"
        wait(1)
        sound:Play()
        script.Parent.Text = "Game starting...."
        wait(3)
        local isChosen = Players:GetChildren()[math.random(1,#Players:GetChildren())]
        local clone = weapon:Clone()
        clone.Parent = isChosen

    end   

end

function updateplayeramount()
    amountOfPlayers = #Players:GetChildren()
end
0
I think it's line 15, try changing to "if amount of players == (1 or 2) then" and line 37, "clone.Parent = isChosen.Backpack" and try moving the last function before the while loop santi_luly1 47 — 1y
0
you fixed my answer although I need to make a remote event and make a local script to put the axe in the backpack, but that is no worries, thank you :) Yodadthin 2 — 1y

Answer this question