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

Why Will My Soccer/Football Goalkeeper Not Move?

Everything in the script works fine, the model Stance goes to the lighting and you can see the Save1 model in the workspace, but it is not behind the ball, it is in the same position it was in the lighting. How do I move the keeper behind the ball 3 studs? Script:

local Detector = script.Parent
local gameBall = game.Workspace.gameBall
local Save1 = game.Lighting.Save1
local Ready = true
local Stance = game.Workspace.Stance

function onTouch(Part)
		if Ready == true then
			Ready = false
			Stance.Parent = game.Lighting
			Save1.Parent = game.Workspace
			Save1.Child.CFrame = CFrame.new(gameBall.Position+Vector3.new(3,0,0))
			wait(2)
			Ready = true
			Stance.Parent = game.Workspace
			Save1.Parent = game.Lighting			 
	end
end

Detector.Touched:connect(onTouch)

2 answers

Just use Position for Line 12 instead of CFrame, it would be much easier than making it a CFrame.

local Detector = script.Parent
local gameBall = game.Workspace.gameBall
local Save1 = game.Lighting.Save1
local Ready = true
local Stance = game.Workspace.Stance

function onTouch(Part)
        if Ready == true then
            Ready = false
            Stance.Parent = game.Lighting
            Save1.Parent = game.Workspace
            Save1.Child.Position = gameBall.Position + Vector3.new(3,0,0) --Puts the keeper 3 studs behind where the ball is.
            wait(2)
            Ready = true
            Stance.Parent = game.Workspace
            Save1.Parent = game.Lighting             
    end
end

Detector.Touched:connect(onTouch)

Make sure the model is NOT anchored. This happens to me a lot and need to make sure you don't have the same issue!

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