So i have tried 2 different ways, neither of them work.
(plr = the player)
1st attempt:
1 | if plr.Backpack [ "Building Tools" ] = = true then |
2 | print ( "btools" ) |
3 | else |
4 | print ( "no btools" ) |
5 | end |
and then my 2nd attempt:
1 | if not plr.Backpack [ "Building Tools" ] = = nil then |
2 | print ( "btools" ) |
3 | else |
4 | print ( "no btools" ) |
5 | end |
Is there a way? All help is appreciated!
Use FindFirstChild function,if it finds the targeted object,it returns true else it returns false
1 | if plr.Backpack:FindFirstChild( "Building Tools" ) then --You dont need to double check it,as it returns the value |
2 | print ( "btools" ) |
3 | else |
4 | print ( "no btools" ) |
5 | end |
Hello, a way you can check if an instance is inside another, you can do this.
1 | local instance = object:FindFirstChild( "whatyouaretryingtofind" ) |
2 | if instance then --true |
3 | --your code here |
4 | else -- false |
5 | --your code here |
6 | end |