I would like to make it so whenever a specific part (that being the ball because I am using ball movement) connected to the vr player touches a teleport pad it will teleport them to another part.
Whenever I touch the part it only teleports the vr character on the server side, and it also isn’t exactly how I want it to teleport the player, like it messes up the cframe and just piles the vr player into one spot.
I’ve tried updating the cilent side with Update:FireCilent but it just says unable to cast value to Object. What I am currently usng to teleport it is by changing the CFrame of each part of the vr player to the CFrame of the location I want them to be at.
Server Script
--Falling--
local void = game.Workspace.Map.void:GetChildren()
local respawn = game.Workspace.location
local function onTouched(part)
if part.Parent:FindFirstChild("CrazySphere") then
wait(1)
part.Parent.Head.CFrame = respawn.CFrame + Vector3.new(0,3,0)
part.Parent.Torso.CFrame = respawn.CFrame + Vector3.new(0,3,0)
part.Parent.RightHand.CFrame = respawn.CFrame + Vector3.new(0,3,0)
part.Parent.LeftHand.CFrame = respawn.CFrame + Vector3.new(0,3,0)
part.Parent.CrazySphere.CFrame = respawn.CFrame + Vector3.new(0,3,0)
Update:FireClient("Teleported", RightHand.CFrame, LeftHand.CFrame, Head.CFrame, CrazySphere.CFrame, LeftHand.CFrame)
end
end
for i,v in pairs(void) do
if v:IsA("BasePart") then
v.Touched:Connect(onTouched)
end
end
end)
If there is a better way of going at this I would like to know!
Thank You!