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

Can someone troubleshoot this OnChatted script?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
game.Players.PlayerAdded:connect(function(player)
  player.Chatted:connect(function(msg)
    if player.Name=="Obscuriti" or player.Name=="Tempestatem" then
        print(player.Name.." Has started a Practice Raid!")
      if msg == "start" then
    songs = game.ServerStorage:GetChildren()
Song1 = songs[math.random(1,#songs)]
Song1.Parent=game.Workspace
if Song1.Name=="M1" then

end
      rval=0
      dval=0 -- It seems to stop working here.
    for k, p in pairs(game.Players:GetPlayers()) do
if rval>dval then
    p.TeamColor=BrickColor.new("Bright red")
elseif dval>rval then
    p.TeamColor=BrickColor.new("Bright blue")
end
end
    end
end
  end)
end)

**Output says nothing. **

0
On line 15 or 17, put >= or <=. It has no base case to start with. You could make it a random selection if you want. GoldenPhysics 474 — 10y
0
Well I want the teams to be even. So if the rval is more than the dval then it makes the players taem the red team, it evens it out Tempestatem 884 — 10y
0
What if they're the same? GoldenPhysics 474 — 10y
0
I thought about that today. Thanks. Tempestatem 884 — 10y

Answer this question