Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I make a tp script that deals damage to people behind me?

This is kind of hard to explain but like, a player tp's behind someone and it deals damage to the person behind them. This is my current tp script and it works fine.

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
 
function teleport(key)
    if key == "f" then
        player.Character.UpperTorso.CFrame = mouse.Hit
    end
end
mouse.KeyDown:connect(teleport)

1 answer

You would have to use Dot Product to find out how "behind" that player is (mathematically comparing both's lookvector).

An AMAZING source I learned from how to use Dot from is this: here

5 comments

0

Also I 100% recommend checking this channel's other videos. They are PURE gold.

0

the link doesn't work

0

oh so sorry. I fixed it now :P

0

thanks homie :)

0

anytime fam :)

This discussion is preserved as it was. New answers, comments, and votes are closed.