made some new data system what fires the data thats on the server as read only on the client to use but the player added fire before the client is loaded what couses it to just refuses to load the game i didnt even touch the game manager but now it just doesnt work only i see is a skybox
PS.PlayerAdded:Connect(function(player: Player)
warn("hi there "..player.Name.."_ID_"..player.UserId)
repeat
wait(1)
warn("sjii")
until player.CharacterAdded
loadPlrAssets(player)
local userId = player.UserId
DH.load(userId)
warn(SD)
end)
all this events + more fire when the client isnt loaded couses the game to dont see any valeu what lets it look like tier data is reseted troug it prints all data and its present
.CharacterAdded isn’t a boolean that you can read, it’s an event, meaning player.CharacterAdded does… absolutely nothing! meaning… your code loops endlessly!
eiter way it seems just to only hapens in studio on the actual client it work not even with this as in some way the characrter seems to exsist but no workspace thuis no end for remote events that be fired before the scripts are loaded
Did you try the code I provided? Chances are that the players character is already loaded, thus the repeat function keeps going until a new character is added.
PS.PlayerAdded:Connect(function(player: Player)
warn("hi there "..player.Name.."_ID_"..player.UserId)
local Character = player.Character or player.CharacterAdded:Wait()
end)
local function LoadKeys(plr)
-- do stuff
remoteEvent:FireClient(plr, stuff)
end
so this function be called before the client is fully loaded in studio only it fires the needed remote events when the client cant resijve in studio only
PS.PlayerAdded:Connect(function(player: Player)
warn("hi there "..player.Name.."_ID_"..player.UserId)
local Character = player.Character or player.CharacterAdded:Wait()
task.wait(1)
LoadKeys(player)
end)