Acutally, it is needed to check that a character is touching, and not something else (such as a hat or a tool). In fact, the script should really be:
script.Parent.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if not Player then return end
t = game.Workspace.trov:clone() --(I'd recommend putting trov into Lighting instead)t.Parent = player.Backpack
end)
If a tool or hat touches the part, this way the script won't glitch out. |