Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 4 years ago

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

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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

0
Also I 100% recommend checking this channel's other videos. They are PURE gold. GGRBXLuaGG 417 — 4y
0
the link doesn't work lolzballz2057 0 — 4y
0
oh so sorry. I fixed it now :P GGRBXLuaGG 417 — 4y
0
thanks homie :) lolzballz2057 0 — 4y
0
anytime fam :) GGRBXLuaGG 417 — 4y
Ad

Answer this question