I need to get the players backpack so that I can change a bool value in their backpack which will stop them from using their abilities.
I get no errors but I don’t know what I’m doing wrong.
game.ReplicatedStorage.Sand.SAV.OnServerEvent:Connect(function(Player)
local x = Instance.new("Part")
x.Shape = Enum.PartType.Ball
x.Parent = game.Workspace
x.Size = Vector3.new(200,200,200)
x.CanCollide = false
x.Anchored = true
x.Position = Player.Character.HumanoidRootPart.Position
local db = false
x.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") == nil then return end
if db == false then
db = true
local hitp = hit.Parent:GetPlayerFromCharacter()
local WS = hit.Parent.Humanoid.WalkSpeed
local JH = hit.Parent.Humanoid.JumpHeight
hit.Parent.Humanoid.WalkSpeed = 1
hit.Parent.Humanoid.JumpHeight = 0
hitp.Backpack.Slow.Enabled = false
wait(3)
hit.Parent.Humanoid.WalkSpeed = 16
hit.Parent.Humanoid.JumpHeight = 7.2
hitp.Backpack.Slow.Enabled = true
db = false
end
end)
wait(1)
x:Remove()
end)
Thanks