I dont seem to know how to do it, so help?
My personal guess is this :
function onTouched() game.Workspace.Player.CFrame = CFrame.new(Vector3.new(2.6, -0.38, 45.26)) end script.Parent.Touched:connect(onTouched)
You have a few problems.
Basically, you're trying to move the player in workspace, which in-game wouldn't work because your player isn't named Player. Now, in studio that won't work either. You need to use part, which is explained in your function.
You're trying to CFrame the player! There is another method of teleportation, but the main problem is that you're not changing their torso's CFrame.
Now, I would like to change a few things in your code. I'm gonna use "GetPlayerFromCharacter" to get the player's Character. I'm also gonna use "MoveTo", which is basically a better way of teleportation in this scenario.
script.Parent.Touched:connect(function(part) local player = game.Players:GetPlayerFromCharacter(part.Parent) local character = player.Character if character ~= nil then character:MoveTo(Vector3.new(2.6, -0.38, 45.26, 0)) end end)
Finally, this is the code. As you can see on line 5, I put a 0 at the end because you need to use 4 different arguments. Figure out what you wanna change that to if you even want to, otherwise leave it be.
--Note you do not need Vector3.new as cframe.new already has its own parameters. --Define Player --CFrame is not a valid member of character --Altho it would be a valid member for parts of the character. --In Studio if u wanna change the name u can. function onTouched() game.Workspace.RRCTrooper.Torso.CFrame = CFrame.new(2.6, -0.38, 45.26) end workspace.Base.Touched:connect(onTouched) -- I made it Base but u can change that
You forgot the part in the function it should be
function onTouched(part)
function onTouched(part) game.Workspace.Player.CFrame = CFrame.new(Vector3.new(2.6, -0.38, 45.26)) end script.Parent.Touched:connect(onTouched)