Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 7 years ago
Edited 7 years ago

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

Log in to vote
0
Answered by 7 years ago

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")
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. Syntax_404 37 — 7y
1
Nevermind. Found myself the solution. Your answer is still helpful through. Have 1 repuptation. :) Syntax_404 37 — 7y
0
You're welcome. Here, have some rep c: Programical 653 — 7y
Ad

Answer this question