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

My script can't make the Cheese teleport to the position. Why?

So, I was developing something. And suddenly, something came in that I don't know how to fix. In this case, here's what I did..

local char = script.Parent.Parent:WaitForChild("Humanoid")
local cheese = script.Parent:WaitForChild(script.Parent.Parent.Cheese)

if char.Health == 0 then
	cheese.Parent = workspace
	cheese.Handle.Position = Vector3.new(-42.735, 9.89, 7.095)
	
end

If you can find out what's wrong, please do tell. I will appreciate your help!

1 answer

✓ Accepted answer

This line doesn't make much sense

local cheese = script.Parent:WaitForChild(script.Parent.Parent.Cheese)

I'm not sure where cheese is located, but I think you're trying to do this

local cheese = script.Parent.Parent:WaitForChild("Cheese")

3 comments

0

Cheese is located inside workspace. When the player gets the cheese, the cheese goes in its backpack. So it is inside the player's backpack when it is being taken.

1

Nevermind. Found myself the solution. Your answer is still helpful through. Have 1 repuptation. :)

0

You're welcome. Here, have some rep c:

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