Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Teleport script error 15:48:32.375 - Teleport is not a valid member of TweenService?

I've made a script to teleport players and it seems not to be working plus I'm getting weird errors like this 15:48:32.375 - Teleport is not a valid member of TweenService please help me fix this

local teleportservice = game:GetService("TweenService")
local place = 4957199801

script.Parent.Touched:Connect(function(hit)
	local player= game.Players:GetPlayerFromCharacter(hit.Parent)
	if player then
		wait(10)
		print("Teleporting To Game")
		teleportservice:Teleport(place, player)
	end
end)

please help

1 answer

✓ Accepted answer

That's because you cannot tween a function like teleportservice to a tween event to fix this simply type the below code:S

local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
 
local placeId = 0 -- replace here
local userId = 1 -- replace with player's userId
 
-- find the player
local player = Players:GetPlayerByUserId(userId)
 
-- teleport the player
TeleportService:Teleport(placeId, player)

If you want to make it when a player touched do this:

local TeleportService = game:GetService("TeleportService")
 
local placeID_1 = 408502340
local placeID_2 = 408502380
 
local function onPartTouch(otherPart)
	local player = game.Players:GetPlayerFromCharacter(otherPart.Parent)
	if player then
		TeleportService:Teleport(placeID_1, player)
	end
end
script.Parent.Touched:Connect(onPartTouch)

11 comments

0

but what if I don't want a loading gui?

0

Edited make sure to accept my answer

0

Ofcourse I will! But not I'm getting errors like 16:15:33.156 - HTTP 403 (Forbidden)? please help

0

Make sure your the owner of the place if your using team create

0

I've tried both of them but still doesn't work for the touch one it doesn't and same goes for the other one

0

I am doing a solo game development so that error shouldn't occur

0

you're not a scripting helper if you post solutions without even explaining. you're just a spoonfeeder. catch this dislike

0

JesseSong try DM'ing me on discord so I can explain my problem deeper discord: Epic#2249

0

Are you going to DM me JesseSong?

0

What do you need help with? Ive tried what I can.

This discussion is preserved as it was. New answers, comments, and votes are closed.