Function Plays Twice?
So I was scripting and I test my game and it worked. Then I tried testing with someone else and it just played the function twice which broke the game due to the fact it removes something that isnt there.
Is it doing this because of there being 2 players? Im pretty sure but I dont know why. Anyone know?
02 | local Players = game.Players:GetChildren() |
03 | for i,v in pairs (game.Players:GetChildren()) do |
04 | if v.Backpack.PlayerValues.InCustody.Value = = false then |
10 | v.PlayerGui.Pre_.Main_.BackgroundTransparency = v.PlayerGui.Pre_.Main_.BackgroundTransparency - 0.1 |
13 | String = "Alright, let's hope that you guys wont foul this one up. I'll try to inform you guys if there is anyone noticing something or if someones calling. Let's just try to keep this nice and quite, ok?" |
14 | Length = string.len(String) |
17 | v.PlayerGui.Pre_.Main_.Talk.Text = (string.sub(String, 1 ,e)) |
21 | local dif = v.PlayerGui.Pre_.Main_.Difficulty |
22 | dif.TextTransparency = dif.TextTransparency - 0.1 |