I have already made a script about it
1 | game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false ) |
2 | local Part = game.Workspace [ "Backpack?" ] |
3 | Part.Touched:Connect( function (Hit) |
4 | local player = game.Players:GetPlayerFromCharacter(Hit.Part) |
5 | if player then |
6 | game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true ) |
7 | end |
8 | end ) |
The script is about the player have already a disabled backpack, when the player touch a part called "BackPack?" the script make the character's backpack enbled again, anybody help me with this?
Server:
01 | local re = Instance.new( "RemoteEvent" , game.ReplicatedStorage) |
02 | re.Name = "Backpack" |
03 |
04 | local part = workspace:FindFirstChild( "Part" ) |
05 | if part then |
06 | part.Touched:connect( function (touch) |
07 | local player = game.Players:FindFirstChild(touch.Parent.Name) |
08 | if player then |
09 | re:FireClient( true ) |
10 | end |
11 | end ) |
12 | end |
Client:
1 | game:service 'StarterGui' :SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false ) |
2 |
3 | local re = game.ReplicatedStorage:WaitForChild( "Backpack" ) |
4 |
5 | re.OnClientEvent:connect( function (bool) |
6 | game:service 'StarterGui' :SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, bool) |
7 | end ) |