Hello everyone, I’m scripting a game that is like Piggy using the tutorial from alvinblox,
In his tutorial he used:
if v.Backpack:FindFirstChild(“PiggyBat”) then v.Backpack.PiggyBat:Destroy() end | |||
---|---|---|---|
if v.Character:FindFirstChild(“PiggyBat”) then v.Backpack.PiggyBat:Destroy() end |
I get this error from it:
PiggyBat is not a valid member of Backpack “Players.Player2.Backpack” - Server - RoundModule:168
09:37:36.546 Stack Begin - Studio
09:37:36.546 Script ‘ServerScriptService.Game Logic.RoundModule’, Line 168 - function RemoveTags - Studio - RoundModule:168
09:37:36.546 Script ‘ServerScriptService.Game Logic’, Line 94 - Studio - Game Logic:94
09:37:36.546 Stack End - Studio
(This error occurs when the round ends, and I’m holding the bat,however it works just fine if i un-equip the bat right before the round ends).
I’m not really sure how I can fix this, does anyone know how?