Teleport script not working

script:

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local humrp = char:WaitForChild("HumanoidRootPart")
local uis = game:GetService("UserInputService")
local debris = game:GetService("Debris")
local ser = game:GetService("ServerStorage")
local parclone = ser:WaitForChild("ParticleEmitter"):Clone()
parclone.Parent = humrp

uis.InputBegan:Connect(function(input, istyping)
	if istyping then return end
	if input.KeyCode == Enum.KeyCode.E then
		parclone.Position = humrp.Position
	task.wait(0.0007)
		humrp.CFrame = humrp.CFrame * CFrame.new(0,0,10)

	end

end)

tthe particle is in serverstorage
the local script is in starterpack

humrp.CFrame = CFrame.new(0,0,10)

2 Likes

teleportation works
its just the particle thats not showing

 Infinite yield possible on 'ServerStorage:WaitForChild("ParticleEmitter")'

Can’t get ServerStorage from Client. Use ReplicatedStorage instead.

3 Likes

how do i make the particle be where the humanoidrootpart old position was?

Get the old position of the HRP before getting the emitter and then create an invisible part there and then parent the emitter to that part.

1 Like

ill try that
ill let you know if it works or not

Tip: set the part’s collision to false, and anchored to true. Then destroy the part when you no longer need the emitter.

thank you so much!! also thank you @SKURMIEE!

You’re welcome, I just wanted to make it simpler. I wasn’t sure if it was going to MULTIPLY the CFrame z distance, so I made sure it didn’t. :slight_smile:

1 Like