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

Why isnt this player kill script working?

Asked by
TrollD3 105
9 years ago

I assume that teams automatically give each side +1 per kill. Now I have a script(below explanation) inside a text label that says if a team scores a point it would show as 1 point on the text label. How would I make this work and if possible make it for ever player killed by team play add +1 to the gui? Script:

if game.Teams.Atlas.Score == 1 then
    script.Parent.Text = "1"
end
if game.Teams.Atlas.Score == 2 then
    script.Parent.Text = "2"
end
if game.Teams.Atlas.Score == 3 then
    script.Parent.Text = "3"
end
if game.Teams.Atlas.Score == 4 then
    script.Parent.Text = "4"
end
if game.Teams.Atlas.Score == 5 then
    script.Parent.Text = "5"
end
if game.Teams.Atlas.Score == 6 then
    script.Parent.Text = "6"
end



1 answer

Log in to vote
0
Answered by 9 years ago

You don't need to create an if/then statement for every number. Using while true do or while wait() do you can execute what you want

while wait() do
script.Parent.Text = game.Teams.Atlas.Score
end
0
Thanks but how would I get my script to add points for each time they kill a player? TrollD3 105 — 9y
0
Oh thats depending on if the gun provides that function, you would have to find if it does. BSIncorporated 640 — 9y
0
okay so assuming the player's team gets points per kill, Why wont my script work? I dont feel like going through the gun scripts lol TrollD3 105 — 9y
0
Well, you're going to have to, no other way of telling. BSIncorporated 640 — 9y
Ad

Answer this question