How do I make an item disappear after using it?

Not an image of the door… The door model/part in explorer (with the script)

image

Also the script please…
Any errors when you run the game?

No errors in the game right now. And ok

image

Ahhhh… You said this was in the handle.
Not script.Parent.Parent:Destroy(), but instead

For the first event:
hit.Parent:Destroy()
For the second event:
player.Backpack["White Key"]:Destroy()

3 Likes

You used hit.Parent.name but it is hit.Parent.Name roblox Lua(U) is very case sensitive so make sure to use Name not name

.name does work although .Name as you suggested, should be used instead.

1 Like

Now it removes the key, but the door does not disappear.

@develofied Read this message (the one i replied to) .name is depracated .Name isn’t

Could you show the new script?

Just so you’re aware tool instances cannot fire the .Touched events of other BasePart instances, their handles (which are BaseParts) however can.

image

this script is in the door.

The script is within the handle I believe

Use .Name not .name it should work dude

plr.Backpack not player.Backpack.

player is underlined in blue indicating that it hasn’t been declared & initilialized.

2 Likes

robloxapp-20220311-1118007.wmv (2.5 MB)

Does your script contain a virus by the way? That last line (comment) looks familiar.

Which line looks familiar to you?

Last synced and the remainder of that line. Click on that line and press the “End” key on your keyboard.