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

CFrame cannot be assigned to?

if this question has been answered before just direct me there, if not then I'd (obviously) ask for the answer to this problem:

script.Parent.Touched:connect(function(hit)
	
	if hit.Parent:FindFirstChild("Humanoid") then
		torso = hit.Parent:FindFirstChild("Torso")
		
			if torso ~= nil then 
				torso.Position.CFrame = CFrame.new(Vector3.new(-6, 0.5, -12))
		    
		end
	end
end)

now I understand its probably better to use a local script, but in certain cases it may be better to use scripts inside the two parts anyway- and actually I've made another teleporter using a local script, the syntax is the same for going through the character and torso and cframe- and it works, but here it doesn't. why is this? I think the problem lies within getting to the players character, or maybe it would be slightly different outside a local script for whatever reason. (that's just my thoughts)

2 comments

0

you are trying to set the CFrame to a Position and not to torso.

0

thanks, and hey! 1waffle1 responded to my post. I played tic tac toe with you and now this!

1 answer

✓ Accepted answer

Your problem is with line 7. Here you wrote:

torso.Position.CFrame = CFrame.new(...)

What I assume you meant to write is:

torso.CFrame = CFrame.new(...)

Position holds a Vector3 value, which doesn't have a member called CFrame.

1 comment

0

oh it was a simple mistake, my bad- but thanks anyway.

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