I've been trying to make a script to where when a player dies, they drop a block that you can collect to gain credits, whenever somebody dies i get the error "Position is not a valid member of Model" in the output, however I'm only cloning a part and not a group, and the part isn't in a group either. ( Haven't added the part where you can actually walk over it to collect credits yet. )
game:GetService('Players').PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").Died:Connect(function()
print(player.Name .. " has died!")
local RS = game:GetService("ReplicatedStorage")
local drop = RS.CreditsDrop:Clone()
drop.Parent = workspace
drop.Position = character.Position
drop.Anchored = false
print("Credits have been dropped")
end)
end)
end)

2 comments
Oh, Thanks for the help!
You're welcome :D don't forget to accept the answer if it helped !