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

Help with OnClient event?

Asked by 8 years ago

LocalScript

event.OnClientEvent:connect(function(...)
    local tuple = {...}
    if tuple[1] == "Result" then
        print("Result")
    end
end)

ServerScript

player:LoadCharacter()

local gameresult = "PlayersWin"

if murdereractive then
    if #activecontestants >= 2 then
        event:FireAllClients("Result", "PlayersWin")
    else
        gameresult = "MurdererWin"
        event:FireAllClients("Result", "MurdererWin")
    end
else
    event:FireAllClients("Result", "PlayersWin")
end

I have these 2 scripts. I didn't post the whole thing, cause its 700+ lines long, but this is the part thats not working. If I dont have the :LoadCharacter then it works, but I NEED the loadcharacter. Is their anyway to get the OnClientEvent to WAIT for all players to have their characters loaded before it firing?

Answer this question