Attempt to index nil with FindFirstChildWichIsA?
I want to make a custom key to drop tools, and everything works fine on the ClientSide of things and an event is fired, but the actual serversided drop script seems to not work, I can't find why, I tried to make char's "Archivable" value true but it gave a different error, here take a look.
01 | local dropEvent = game.ReplicatedStorage.DropEvent |
03 | function onPlayerAdded(plr) |
04 | local char = plr.Character |
06 | local function dropItem() |
07 | local tool = char:FindFirstChildWhichIsA( "Tool" ) |
08 | tool.Parent = game.Workspace |
10 | dropEvent.OnServerEvent:Connect(dropItem) |
13 | game.Players.PlayerAdded:Connect(onPlayerAdded) |
The output was:
ServerScriptService.Script:7: attempt to index nil with 'FindFirstChildWhichIsA'
Help would be appreciated, thanks.