ok whats going on
so imagine this. you made a variable.
var = 1
then you made it print the variable
var = 1
print(var)
then you set it to a textlabel in a gui
var = 1
print(var)
script.Parent.textlael.Text = var
...then the textlabel said 0.
can somebody explain what causes this? my code:
sp = script.Parent
sp.winslabel.Text = "wins"
sp.losslabel.Text = "losses"
player = script.Parent.Parent.Parent.Parent
player:WaitForChild("wins")
player:WaitForChild("losses")
sp.playername.Text = player.name
wins = player.wins.Value
losses = player.losses.Value
data = game:GetService("TeleportService"):GetLocalPlayerTeleportData()
print(data)
datadata = data
if datadata == 1 then
--goes wrong in this loop
wins = wins + 1
player.wins.Value = player.wins.Value + 1
print("win")
sp.winswins.Text = wins
sp.losseslosses.Text = losses
print(wins)
print(losses)
end
if datadata == 0 then
--goes wrong in this if loop
losses = losses + 1
player.losses.Value = player.losses.Value + 1
print("loss")
sp.winswins.Text = wins
sp.losseslosses.Text = losses
print(wins)
print(losses)
end
thanks so much!

2 comments
What does data print and is this in a LocalScript or Server Script?
its a localscript and data prints a 1 or 0 returning from another place