Backpack CoreGui not working

  1. What do you want to achieve? Keep it simple and clear!
    I want to disable the players backpack when they sit and enable it when they get up

  2. What is the issue? Include screenshots / videos if possible!
    When the player sits down, the backpack doesn’t disable

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried YT and Devforum, i have also tried putting the local script in all the places, starter pack, startergui, starterplayerscripts and startercharacterscripts

Heres my local script in starter player scripts

game.ReplicatedStorage.BackpackEvent.OnClientEvent:Connect(function(value)
	local StarterGui = game:GetService("StarterGui")
	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, value)
end)

And here is my script in server script service (dont mind the other stuff, thats car stuff i have for my game, the important parts are where it fires the remote event “BackpackEvent”

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		character.Humanoid.Seated:Connect(function(active, seatPart)
			if seatPart == nil then
				game.ReplicatedStorage.HideCarGUI:FireClient(player)
				game.ReplicatedStorage.EnableProximityPrompts:FireClient(player)
				game.ReplicatedStorage.BackpackEvent:FireClient(player, true)
				
				for i,v in pairs(character:GetDescendants()) do
					if v:IsA("BasePart") or v:IsA("Decal") then
						if v.Name == "HumanoidRootPart" then

						else
							v.Transparency = 0
						end
					end
				end
				
				for i,v in pairs(character:GetDescendants()) do
					if v.Name == "PickpocketPrompt" and v:IsA("ProximityPrompt") then
						game.ReplicatedStorage.PickpocketPromptEvent:FireAllClients(player)
					end
				end
			elseif seatPart.Name == "CarSeat" then
				seatPart.Parent.Name = player.Name.."'s Car"

				for i,v in pairs(character:GetDescendants()) do
					if v:IsA("BasePart") or v:IsA("Decal") then
						v.Transparency = 1
					end
				end
				seatPart:SetNetworkOwner(player)
				game.ReplicatedStorage.ShowCarGUI:FireClient(player, seatPart)
				seatPart.Parent.Owner.Value = player.Name
				game.ReplicatedStorage.DisableProximityPrompts:FireClient(player)
				game.ReplicatedStorage.BackpackEvent:FireClient(player, false)
			elseif seatPart.Name == "PassengerSeat" then
				for i,v in pairs(character:GetDescendants()) do
					if v:IsA("BasePart") or v:IsA("Decal") then
						v.Transparency = 1
					end
				end
				game.ReplicatedStorage.DisableProximityPrompts:FireClient(player)
				game.ReplicatedStorage.BackpackEvent:FireClient(player, false)
			else
				game.ReplicatedStorage.DisableProximityPrompts:FireClient(player)
				game.ReplicatedStorage.BackpackEvent:FireClient(player, false)
			end
		end)
	end)
end)

For some reason it just doesnt work, im pretty sure no other scripts are interfering with this because i checked them all. I also tried printing what it does to the backpack and its all good, false when the player sits down and true when they stand up.

Heres a video of it:

Also i tested this in another game and it works, idk what’s wrong, it might be another script somewhere interfering with this

Set the boolean to false, since you want to deactivate it

1 Like

I did, further on in the script. that bit of code u showed is when the player stands up

??? Pls help i need to figure this out

I really don’t know, it works completely fine on my side (if i copy your code logic), it’s probably a script interfering your way.

1 Like

Yea, im pretty sure it is, Ill check again

I tried adding this

repeat
	wait()
	game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
until game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)

and it glitches, it alternates from enabled to disabled

Try searching with CTRL + Shift + F this: SetCoreGuiEnabled

1 Like

Ok, i did it and i found some scripts with it in it, but i added a print before it and when i play, those scripts arent part of the problem, so no script is interrupting this script

WAIT, i might’ve found the problem, once sec, ima fix it and let u know

OMG THANKS, it worked, i found a problem in one of the scripts, maybe i didnt check properly

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