Teleport not working

Title…

Heres the output / error: “mouse.hit.p teleports to void”

2 Likes

Can you share the script that you use

yea one sec

testttttttttttttttttttttttttttttttt

Teleport.OnServerEvent:Connect(function(player,tool,hutp)

local char = player.Character
local humr = char:WaitForChild("HumanoidRootPart")
local passengers = {}
local tp = SFXAssets.Teleport:Clone()
tp.Parent = humr
tp:Play()

humr.CFrame = hutp

end)

So you are wanting doesn’t teleport to void when you click

1 Like

yea, by the way heres the new script:

Teleport.OnServerEvent:Connect(function(player,tool,hutp)

local char = player.Character
local humr = char:WaitForChild("HumanoidRootPart")
local passengers = {}
local tp = SFXAssets.Teleport:Clone()
tp.Parent = humr
tp:Play()

humr.Position = hutp

end)

You can use raycasting to solve that but if you want an easy way here Best way to make "Void-proof" placement system? - #3 by TOP_Crundee123

i will try it thxxxxxxxxxxxxxxxxxxxxxxxxxxxx

it isnt working :ccccccccccccc

Where is hutp. If undefined, should define it.

Add an if statement to check if the target exists:

if mouse.Target then
	--do your code
end

Alright ill try it out as soon as possible, Thanks!