spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 09 Nov 2016 01:40 PM |
Im trying to get this to make the text = the xp that was added but everytime it gets 100 higher when i increase by 100.
local XpGui = script.Parent.LevelObjects.XpGui local Active = false game.Players.PlayerAdded:connect(function(Player) wait(1) local LocalPlayerStats = game.ServerStorage["Player Stats"]:WaitForChild(Player.Name) local PlayerStats = game.ServerStorage["Player Stats"] local XP = LocalPlayerStats.XP local XpValues = script.XpValues:Clone() XpValues.Parent = PlayerStats XpValues.Name = "XpValues-"..Player.Name local OldXp = XpValues.OldXp OldXp.Value = XP.Value XP.Changed:connect(function() wait(0.1) if XP.Value == OldXp.Value then local XpAdded = XpValues.XpAdded XpAdded.Value = (XP.Value - OldXp.Value) local PreXp = XpValues.PreXp PreXp.Value = (XP.Value - OldXp.Value) local XPGui = XpGui:Clone() XPGui.Parent = Player.PlayerGui XPGui.XpV.Text = (XpAdded.Value) elseif XP.Value > OldXp.Value then local XpAdded = XpValues.XpAdded local PreXp = XpValues.PreXp XpAdded.Value = (XP.Value - PreXp.Value) PreXp.Value = (XP.Value - XpAdded.Value) XpAdded.Value = (XP.Value - PreXp.Value) local XPGui = XpGui:Clone() XPGui.Parent = Player.PlayerGui XPGui.XpV.Text = (XpAdded.Value) end; end); end);
|
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 09 Nov 2016 01:57 PM |
So basically if a player gains 100 xp, i want the Text to say + 100 which on the first time the player gains xp, its right but not anytime after that.
|
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
| |
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
| |
|