I am trying to get some tools to load in the backpack. These tools are in StarterPack. They don’t appear in the Backpack upon testing. This didn’t happen until after I made a custom menu GUI. I was experimenting with custom player backpacks, however I deleted the script for that. I would like my tools to be back, now that my menu GUI is working. Unfortunately, I can’t figure out why. I have tried looking in scripts to make sure they are all correct, and they were. I tried deleting unnecessary scripts that might be causing the problem. I tried the Roblox script to disable the default backpack I just replaced false with true in a while true loop. That didn’t work either. This is my first actual project and first time as a dev. I’ve done most of the scripting with examples and models by myself, however, the game is unplayable with this error. It’s a TPS and the game was coming along great for a while. Any help, advice, or knowledge will be helpful! (Also, my explorer is kinda messy so I’ll only post snapshots if necessary.)
Can you send screenshots of the tools? And scripts?
Could you check for any malicious scripts by searching in the Search Bar:
getfenv
getrenv
getsenv
getmenv
require()
Here is tools.
What scripts did you mean? (I have a lot.)
So they just disappeared after adding your menu?
I bet a script involving your custom menu GUI disables your backpack CoreGui. Check your script to make sure theres no lines that say something like:
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
If so, try and enable the backpack CoreGui again once the custom menu is gone by putting in:
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
You can learn more about enabling/disabling CoreGui here.
I searched all my GUI scrips. I didn’t see any line that disables the backpack. Here is the code for my teleport buttons, and the GUI disappear on Space Key pressed. These scripts work also. wait() pcall(function() local starterGui = game:GetService('StarterGui') starterGui:SetCore("TopbarEnabled", false) end)
part of my background Gui. `wait(1)
player = game.Players.LocalPlayer
button = script.Parent
local debounce = false
function teleport()
if not debounce then
debounce = true
LowerTorso = player.Character.LowerTorso
LowerTorso.CFrame = game.Workspace.Map2.Main.CFrame
end
end
button.MouseButton1Click:Connect(teleport)
while true do wait()
debounce = false
wait(1)
end` my tp script
`wait(1)
player = game.Players.LocalPlayer
button = script.Parent
local debounce = false
function teleport()
if not debounce then
debounce = true
LowerTorso = player.Character.LowerTorso
LowerTorso.CFrame = game.Workspace.Map.Main.CFrame
end
end
button.MouseButton1Click:Connect(teleport)
while true do wait()
debounce = false
wait(1)
end` -my other tp script
Finally, my disappear script. I added a line to enable the backpack along with invisible the Guis. @Kennykorn This didn’t work sadly.
local UserInputService = game:GetService(“UserInputService”)
local Controller = require(game.Players.LocalPlayer:WaitForChild(“PlayerScripts”):WaitForChild(“PlayerModule”)):GetControls()
Controller:Disable() --disables movement
function keyPressed(input)
if input.KeyCode == Enum.KeyCode.Space then
script.Parent.Parent.Parent.Enabled = false
script.Parent.Parent.Parent.Parent.ScreenGui1.ImageLabel.Visible = false
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
Controller:Enable()
end
end
game:GetService(“UserInputService”).InputBegan:connect(keyPressed)
I did do some virus removal so I think it has to be one of my script causing the problem.
Hi @GAVIN2419329,
Im Not very sure, but try to create a Script to put in the ServerScriptService and paste the following.
function onPlayerAdded(player)
player.CharacterAdded:connect(function()
for _, team in pairs(game:GetService("Teams"):GetChildren()) do
if team.TeamColor == player.TeamColor then
for _, instance in pairs(team:GetChildren()) do
instance:Clone().Parent = player.Backpack
end
end
end
end)
end
for _, player in pairs(game.Players:GetPlayers()) do
onPlayerAdded(player)
end
game.Players.PlayerAdded:connect(onPlayerAdded)
This works more for teams, but it could also work for you’re problem.
keep me updated
I tried this and it didn’t work.
Alright, I’ll think about it.
if I get an idea I’ll come back to you
I did some detective work, and the tools still work in a blank baseplate with the working Gui. Now to find the faulty script.
(I mean the backpack loaded with nothing but the Gui and tools.)
Hello! I found the problem. One of the scripts is the problem. I have no clue why. It disables the top bar during Gui. I guess it needs to be re-enabled. I’ll try this out now.
I found the faulty script but cannot seem to fix it.
Okay, after a while I was able to fix it!
Thanks for your help guys!
The problem was re-enabling the top bar after the Gui was excused.
Anyone know why?
Or was this an obvious problem I didn’t share enough about?
It was because of the CoreGui being disabled like I said earlier. You probably disabled the CoreGui somewhere in your script and just forgot to re-enable it after the GUI goes away. Good luck with your game!