ywisis
|
  |
| Joined: 07 Dec 2014 |
| Total Posts: 1481 |
|
|
| 12 Mar 2017 08:19 AM |
???? It is a member of PlayerGui though.
Can anyone tell me how to fix?
for i, v in pairs(game.Players:GetChildren()) do if player.TeamColor == BrickColor.new("Electric blue") then num1 = num1 + v.leaderstats.kills.Value player.PlayerGui.ScreenGui.blue.Text = num1 num1 = 0 end end
|
|
|
| Report Abuse |
|
|
ywisis
|
  |
| Joined: 07 Dec 2014 |
| Total Posts: 1481 |
|
| |
|
Seviro
|
  |
| Joined: 08 Dec 2009 |
| Total Posts: 46758 |
|
|
| 12 Mar 2017 08:51 AM |
What is the script a child of and is it a LocalScript
r+://290109653 |
|
|
| Report Abuse |
|
|
F_lipe
|
  |
| Joined: 25 Apr 2015 |
| Total Posts: 5917 |
|
| |
|
ywisis
|
  |
| Joined: 07 Dec 2014 |
| Total Posts: 1481 |
|
|
| 12 Mar 2017 08:57 AM |
| it's not a localscript and its a child of ServerScriptService |
|
|
| Report Abuse |
|
|
Seviro
|
  |
| Joined: 08 Dec 2009 |
| Total Posts: 46758 |
|
|
| 12 Mar 2017 09:03 AM |
local player = game.Players.LocalPlayer local playergui = script.Parent.Parent local electricBlue = BrickColor.new("Electric blue") local textUI = script.Parent.blue local textLabel = textUI.Text
for i, v in pairs(game.Players:GetChildren()) do if player.TeamColor == electricBlue then num1 = num1 + v.leaderstats.kills.Value playergui.ScreenGui.blue.Text = num1 num1 = 0 end end
put that in a LocalScript as a child of your UI "ScreenGui" i'm assuming and it should work
r+://290109653 |
|
|
| Report Abuse |
|
|
Seviro
|
  |
| Joined: 08 Dec 2009 |
| Total Posts: 46758 |
|
|
| 12 Mar 2017 09:03 AM |
local playergui = script.Parent.Parent local electricBlue = BrickColor.new("Electric blue") local textUI = script.Parent.blue local textLabel = textUI.Text
for i, v in pairs(game.Players:GetChildren()) do if player.TeamColor == electricBlue then num1 = num1 + v.leaderstats.kills.Value textLabel = num1 num1 = 0 end end
correction
r+://290109653 |
|
|
| Report Abuse |
|
|
Seviro
|
  |
| Joined: 08 Dec 2009 |
| Total Posts: 46758 |
|
|
| 12 Mar 2017 09:06 AM |
if that doesn't work all you need to do is create a function "player" that is:
local player = game.Players.LocalPlayer
and then you should find PlayerGui properly
r+://290109653 |
|
|
| Report Abuse |
|
|