-
What do you want to achieve? Player level value and xP value shows even when the player resets on the levelbar gui
-
What is the issue? Player level value and xP value dont show when the player resets on the levelbar gui
-
What solutions have you tried so far? I have tried toggling resetonspawn already, but no fix.
The GUI is still visible but this is what happens…
When Resetting:
local maxWidth = 0.942
local Players = game:GetService("Players")
local Manager = require(game:GetService("ServerScriptService").PlayerData.Manager)
local addxP = require(game.StarterPlayer.StarterPlayerScripts.addxP)
local TweenService = game:GetService("TweenService")
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
print("playerdetected")
local bar = player.PlayerGui:WaitForChild("Level"):WaitForChild("Frame"):WaitForChild("Frame"):WaitForChild("Roundify")
local xP = player.PlayerGui:WaitForChild("Level"):WaitForChild("Frame"):WaitForChild("xP")
local Level = player.PlayerGui:WaitForChild("Level"):WaitForChild("Frame"):WaitForChild("Level")
local profile = Manager.Profiles[player]
while true do
local goal = {}
goal.Size = UDim2.new((player:WaitForChild("xP").Value/addxP.EF(player.leaderstats.Level.Value)* maxWidth) , 8, 0, 8)
local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Sine)
local tween = TweenService:Create(bar, tweenInfo, goal)
xP.Text = player:WaitForChild("xP").Value.."/"..addxP.EF(player.leaderstats.Level.Value).." xP"
Level.Text = "Level: "..player:WaitForChild("leaderstats").Level.Value
tween:Play()
--bar.Size = UDim2.new((profile.Data.xP/addxP.EF(profile.Data.Level)* maxWidth) , 8, 0, 8)
print("updating")
task.wait()
end
end)
end)