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.
local dropEvent = game.ReplicatedStorage.DropEvent function onPlayerAdded(plr) local char = plr.Character local function dropItem() local tool = char:FindFirstChildWhichIsA("Tool") tool.Parent = game.Workspace end dropEvent.OnServerEvent:Connect(dropItem) end game.Players.PlayerAdded:Connect(onPlayerAdded)
The output was:
ServerScriptService.Script:7: attempt to index nil with 'FindFirstChildWhichIsA'
Help would be appreciated, thanks.
The character hasn't loaded yet. Fix this with
local char = player.Character or player.CharacterAdded:Wait()