I had someone answer my last question on it, with a script, but their script doesn't work for some reason, I think it was because they put handle.Cframe, and there isnt a handle... anyway, i was wondering if someone could teach me about teleportation when a person dies, here is the script :D
repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character local p = game.Players.LocalPlayer local c = p.Character local h = c:WaitForChild("Humanoid") local storage = game.ReplicatedStorage["Folder"] --folder with items local playerInventory = p.PlayerGui["inventory"] --Wherever you're putting the player's inventory h.Died:connect(function() for i,v in pairs(playerInventory:GetChildren()) do if v:IsA("StringValue") then local storageItem = storage:findFirstChild(v.Value) if storageItem then print("Dropped "..v.Value) clo = storageItem:Clone() clo:MoveTo(c.Torso.Positon + Vector3.new(math.random(-5,5),0,math.random(-5,5))) clo.Parent = Workspace end end end end)
Missing an end + misspelled Position
on line 16.
repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character local p = game.Players.LocalPlayer local c = p.Character local h = c:WaitForChild("Humanoid") local storage = game.ReplicatedStorage["Folder"] --folder with items local playerInventory = p.PlayerGui["inventory"] --Wherever you're putting the player's inventory h.Died:connect(function() for i,v in pairs(playerInventory:GetChildren()) do if v:IsA("StringValue") then local storageItem = storage:findFirstChild(v.Value) if storageItem then print("Dropped "..v.Value) clo = storageItem:Clone() clo:MoveTo(c.Torso.Position + Vector3.new(math.random(-5,5),0,math.random(-5,5))) clo.Parent = Workspace end end end end end)