#How can I get the script to check if the Tool is inside of Player or inside a Backpack?

1 messages · Page 1 of 1 (latest)

twin swift
#

I Included both "IfChar or "IfBackpack
but only IfChar are working, what am I'm doing wrong?

        if script.Parent.Parent.Parent.Name == char.Name then
            char = script.Parent.Parent.Parent
            local HRP = char.HumanoidRootPart```
#

if both of them are seperately, for example

If text == IfChar then

elseif text == IfBackpack then

then both of them would work fine, however I am trying to rescript the whole thing, and making the script to become shorter and cleaner are one of them

verbal spindle
#

Tools that aren’t in the backpack are inside your character and you access your players backpack by indexing the player so you could do something like if tool.parent == player.character then else if tool.parent ==player.backpack then
end

#

Sorry for bad formatting I’m on phone right now

twin swift
#

alright, thank.

#

althought I had already figured it out

verbal spindle
#

Yea response was pretty late lol glad you figured it out