I'm trying to make a script where when player kills a the monster, they'll get teleported. Confused by my own script though. Here's my script:
local Humanoid = script.Parent.Humanoid
function Teleport()
local tag = Humanoid:FindFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local p = game.Players:GetPlayerFromCharacter("tag.Value")
p.Character.Humanoid.Torso.CFrame = script.Parent.TeleOut.CFrame
wait(0.1)
script:remove()
end
end
end
Humanoid.Died:connect (Teleport)
After they killed the monster, they'll get teleported to where "TeleOut" is.

2 comments
Could you explain what you need help with? Is your script doing something weird?
After I killed the monster, it's not teleporting me to where "TeleOut" is