Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- variables vvv
- local Character = script.Parent
- local Humanoid = Character:FindFirstChildOfClass("Humanoid")
- local RootPart = Character["HumanoidRootPart"]
- local ServiceRS = game:GetService("ReplicatedStorage")
- local ItemFolder = ServiceRS:WaitForChild("Items") -- folder name
- -- configuration vv | note: dont enable isapart and isatool at the same time
- local IsaPart = true -- if the item is a part/meshpart/union
- local IsaTool = false -- if the item is a tool
- local ItemName = "MeshPart"
- -- when player dies vvv
- Humanoid.Died:Connect(function()
- local item = ItemFolder:WaitForChild(ItemName):Clone() -- get the item from the folder & clone it
- if IsaTool then
- item.Handle.CFrame = RootPart.CFrame -- cframe of the item(area of drop)
- item.Parent = workspace -- parent of the item
- elseif IsaPart then
- item.CFrame = RootPart.CFrame
- item.Parent = workspace
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement