Backpack is not a valid member of Model “Workspace.Player2”
how to fix that the value is find in player backpack but the script cant find the value
– i try this script–
enemy.Backpack.Value.UsingMove.Value = false
Backpack is not a valid member of Model “Workspace.Player2”
how to fix that the value is find in player backpack but the script cant find the value
– i try this script–
enemy.Backpack.Value.UsingMove.Value = false
I can’t understand whatcha saying, neither what you’re trying to achieve.
the output said Backpack is not a valid member of Model “Workspace.Player2”
and i want to fix it and i use this script
enemy.Backpack.Value.UsingMove.Value = false
You did not specify what is the enemy nor the value. Example:
local enemy
-- your code to set up the enemy players here
enemy = game:GetService("Players").PATH_TO_THE_PLAYERS
local value = enemy.Backpack.Value.UsingMove.Value = false
-- your code here
local Hitbox = script.Hitbox:Clone()
Hitbox.Parent = game.Workspace
Hitbox.CFrame = char.PrimaryPart.CFrame * CFrame.new(0,0,Hitbox.Size.Z/2 * -1)
Debris:AddItem(Hitbox,.3)
local Connection
Connection = Hitbox.Touched:Connect(function(hitpart)
if not hitpart:IsDescendantOf(char) then
if hitpart.Parent:FindFirstChild("Humanoid") then
local enemy = hitpart.Parent
enemy.Backpack.Value.UsingMove.Value = false
Can you show me the output so I can see the error?
Ah I see.
The “Backpack” item is inside the player in the player service, not in workspace. A random example could be:
WRONG WAY:
workspace.achdef.Backpack -- this would error
CORRECT WAY:
game:GetService("Players").achdef.Backpack -- this is only a example
so what should i change? and how i change?
I edited my post. The correct way should work, except that you replace achdef by the enemies players.
local enemyss = game:GetService("Players")
local enemys = enemyss.Backpack
local enemyss = game:GetService("Players")
enemyss = enemyss.Backpack
local Player = "Player2" -- This is the player that I am reffering to, in this case "Player2" is his username
local PlayerService = game:GetService("Players")
print(PlayerService:WaitForChild(Player).Backpack.Name) -- The backpack is located inside of "Players.Player2", not "Workspace.Player2"