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

[UNANSWERED] Why does this script fail to execute? (No errors in output window)

The script below used to work but Roblox broke it. Any help?

local t = script.Parent.Trainer.Value
local g = Instance.new("BodyGyro",script.Parent)
while wait() do
	local list = game.Workspace:GetChildren()
	for i = 1, #list do
		local n = list[i]
		if n.Name == t then
			local torso = n:FindFirstChild("Torso")
			script.Parent:WaitForChild("Pokemon"):MoveTo(torso.Position - (torso.CFrame.lookVector * 3),torso)
			g.cframe = CFrame.new(script.Parent.Torso.Position,torso.Position)
		end
	end
end

1 comment

0

I have failed to understand why there are two values in the CFrame.new() on line 10. I have never seen two values in a single CFrame.new, so I am curious why they are there.

2 answers

What are you trying to do? What is 'script.Parent'? What is 'script.Parent.Trainer'? What is 'Pokemon'? We need more information.

Anyways, you could try using CFrame.new(startPosition,lookAt) instead of a BodyGyro.

2 comments

0

The script is supposed to make the "Pokemon" follow its trainer, going through all the players' characters and searching for its owner.

0

But what IS pokemon? What Instance? Also what Instance is Trainer? Where is everything located?

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