R

[lollypophub] tween to selekted plr

public
rrixh Jul 23, 2024 Never 53
Clone
Bash forLollypopHub-tweenToSelektedPlr.xlsx 21 lines (21 loc) | 1.17 KB
1
local player = game.Players.LocalPlayer
2
local targetPlayer = game.Players:FindFirstChild(selektedPlayerName)
3
if targetPlayer and targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") then
4
local targetPosition = targetPlayer.Character.HumanoidRootPart.Position
5
if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
6
local humanoidRootPart = player.Character.HumanoidRootPart
7
local targetCFrame = CFrame.new(targetPosition)
8
local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
9
local tween = TweenService:Create(humanoidRootPart, tweenInfo, {CFrame = targetCFrame})
10
tween:Play()
11
tween.Completed:Connect(function()
12
print("“"..selektedPlayerName.."“")
13
end)
14
else
15
bNotif(3, "aight", "Player or HumanoidRootPart not found.")
16
end
17
else
18
bNotif(3, "aight", "Player or their HumanoidRootPart not found")
19
end
20
else
21
bNotif(2, "oops im dumb", "No player selekted")