Level Value of Gui and xP Value of GUI disappears when player resets[SOLVED]

  1. What do you want to achieve? Player level value and xP value shows even when the player resets on the levelbar gui

  2. What is the issue? Player level value and xP value dont show when the player resets on the levelbar gui

  3. 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…
image
When Resetting:
image


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)



3 Likes

What do you mean by this? Does the GUI disappear after you reset?

1 Like

The GUI is still visible but this is what happens…
image
When Resetting:
image

1 Like

still unsolved if anyone can still help?

1 Like

Still unsolved lol someone help me if they can

i actually stupidly edited the reset to spawn and it worked this time i did it which was weird sorry

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.