Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a part when touched make the backpack enabled?

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
local Part = game.Workspace["Backpack?"]
Part.Touched:Connect(function(Hit)
local player = game.Players:GetPlayerFromCharacter(Hit.Part)
if player then
	game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
end
end)


**** So that scripts that i wanted to try. I'll explain; first it makes the backpack disabled. then when a player touch a part called "BackPack?" it makes the backpack enabled again.. I couldn't continue the script when the player touch another part for example called "Return BackPack" It makes it disabled! Please I need this so badly. Thanks for reading/helping !

1 comment

0

first thing u need to change is like 4, change (Hit.Part) to (Hit.Parent)

1 answer

I can't give you the complete code but I can give you the touched event

local backpack = script.Parent

backpack.Touched:Connect(function(hit)
	local humRoot = hit.Parent:WaitForChild("HumanoidRootPart", 10)
	if humRoot then
		--Code
	end
end)

1 comment

0

Thanks! I'll try it out!

This discussion is preserved as it was. New answers, comments, and votes are closed.