-
Im trying to set it up so when the player leaves they “drop” the custom tool I have made (by just making a clone and dropping it where their character was when they left)
-
*Everything works except I cannot reference the position of the character since they left. ive never worked with this type of stuff before.
Is there a simple way to get the players position in the PlayerRemoving system or do I need another function or script to be getting their position?
game.Players.PlayerRemoving:Connect(function(player)
local Char = game.Workspace:FindFirstChild(player.Name)
local CharacterPos = Char.HumanoidRootPart.Position
print(CharacterPos)
if player.Carrying.Value == "True" then
local ToolName = player.Carrying2.Value
local NewTool = game.ReplicatedStorage.SpawnedItems:FindFirstChild(ToolName)
NewTool.Name = ToolName
NewTool.Parent = game.workspace
NewTool.Position = CharacterPos -- This is the line that gets me, everything works I just cant spawn it at the position of the player who left.
end
end)
Any help is appreciated, and if you need more info about other scripts I have let me know, but I think this is all thats needed to solve the issue.