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

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

Asked by
RedCombee 585 Moderation Voter
10 years ago

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
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. SanityMan 239 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago

This might not fix your error or it will. On line 10 you did "cframe" not "CFrame". Anyways this fixes one error maybe not all them but a upvote is appreciated.

0
Body forces have to have "CFrame" lowercased. RedCombee 585 — 10y
0
"cframe" is a property of BodyGyro: http://wiki.roblox.com/index.php?title=Bodygyro SanityMan 239 — 10y
0
Sorry bout that anyways thanks for correcting me. GetSporked 5 — 10y
Ad
Log in to vote
0
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago

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.

0
The script is supposed to make the "Pokemon" follow its trainer, going through all the players' characters and searching for its owner. RedCombee 585 — 10y
0
But what IS pokemon? What Instance? Also what Instance is Trainer? Where is everything located? Perci1 4988 — 10y

Answer this question