✓ Accepted answer
It's just because of the name. You can't list it like that if there's a space or symbol in the name. You have to either rename it, or do something like this
brick = script.Parent
brick.Touched:connect(function(part)
if part.Parent.Humanoid then
if part.Parent.Humanoid.Health > 0 then
Player = game.Players:GetPlayerFromCharacter(part.Parent)
game.ReplicatedStorage["Cup (Empty"]:clone().Parent = Player.Backpack
end
end
end)
Also be aware that if you put it in the StarterPack, the player won't see the item until they restart their character.
2 comments
How can I put it into a characters inventory?
I've edited the script. Put the tool in ReplicatedStorage, not StarterGUI. StarterGUI is for GUIs. Replicated storage is for storing items and models. If the part that touched the brick is a hat though, the event will disconnect. Make the brick smaller than a character model.