Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I go about disabling a certain player's backpack?

Asked by 4 years ago
Edited by User#24403 4 years ago

I have a script that when clicked, teleports you, and plays an animation, but it still allows you to pull out tools, which is unrealistic for my game. Any help? Here is my script

dog = false

script.Parent.MouseClick:Connect(function(player)
    if dog == false then
        dog = true
        local character = player.Character
        character.HumanoidRootPart.CFrame = game.Workspace.TeleportPart.CFrame
        character.HumanoidRootPart.Anchored = true
        game.Workspace.ChinUpBar.CanCollide = false
        player.PlayerGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)

        local animation = character.Humanoid:LoadAnimation(script.Animation)
        animation:Play()
        wait(13)
        animation:Stop()
        character.HumanoidRootPart.Anchored = false
        game.Workspace.ChinUpBar.CanCollide = true
        dog = false
    end
end)
0
SetCoreGuiEnabled is a StarterGui function, not a PlayerGui. Use remotes to disable a certain player's backpack. User#24403 69 — 4y
0
I already answered this with my long answer and you deleted the question so im just going to give you the example: https://web.roblox.com/games/3266086881/Disable-Backpack namespace25 594 — 4y
0
Alright thank you both. Pooglies 7 — 4y

Answer this question