---------------------------------getting values from data store---------------------------------- local DSS = game:GetService("DataStoreService") local value_to_add = script.value_to_add.Value local loading_type_store = game:GetService("DataStoreService"):GetDataStore("loading_type") function load_type(player) ------ loading screen wait(1) local player_gui = player.PlayerGui local player_id = player.UserId local character = player.Character local wf_copy = character.what_failed:Clone() local loading_type_value = character.load_type_selected local loading_type local success, err = pcall(function() loading_type = loading_type_store:GetAsync(player_id) end) if success then loading_type_value.Parent = character.loading_screen if loading_type == nil then warn("could not retrieve data") character.what_failed.Value = "getting load screen number" wf_copy.Parent = player_gui else character.loading_screen.loading_type_value.Value = loading_type end character.loading_screen.Parent = player_gui print("success") else warn("could not retrieve data") character.what_failed.Value = "getting load screen number" wf_copy.Parent = player_gui end end ---------------------------------setting values to data store------------------------------------ function leaving(player) ------ loading screen local player_gui = player.PlayerGui local player_id = player.UserId local bricks_selected_value = player_gui.loading_screen.logo.loading_types.bricks.selected.value local roblox_selected_value = player_gui.loading_screen.logo.loading_types.roblox.selected.value local square_wheels_selected_value = player_gui.loading_screen.logo.loading_types.square_wheels.selected.value local studs_selected_value = player_gui.loading_screen.logo.loading_types.studs.selected.value if bricks_selected_value == "true" then loading_type_store:SetAsync(player_id, "bricks") end if roblox_selected_value == "true" then loading_type_store:SetAsync(player_id, "roblox") end if square_wheels_selected_value == "true" then loading_type_store:SetAsync(player_id, "square_wheels") end if studs_selected_value == "true" then loading_type_store:SetAsync(player_id, "studs") end end game.Players.PlayerAdded:Connect(load_type) game.Players.PlayerRemoving:Connect(leaving)
i am trying to make it so when the player leaves it will save what loading icon the player saved but roblox studio is giving me a maaaddddd look
saying that player gui doesn't exist
trying to fool me
help me show roblox studio who is boss