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

How do I fix this script? (simple)

local part = script.Parent

function move(onTouch)
	if part.CFrame == (-22.467, 7.1, 61.213) then
		part.CFrame * part.CFrame.new(10, 10, 10)
	end 
end

part.Touched:connect(move)

I'm getting an output error "Workspace.Part.Script:4: ')' expected near ','" the comma it's talking about it the one after 22.467.

1 answer

You should use position for this eg.

local part = script.Parent

function move(onTouch)
    if part.Position == (-22.467, 7.1, 61.213) then
        part.Position = (part.Position * Vector3.new(10, 10, 10))
    end 
end

part.Touched:connect(move)

Hope this helps

2 comments

0

still getting the same output

0

try adding a ) at the end of if part.Position == (-22.467, 7.1, 61.213)

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