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

How do I fix this script? (simple)

Asked by 8 years ago
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

Log in to vote
-1
Answered by
xuefei123 214 Moderation Voter
8 years ago

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

0
still getting the same output DarwinYork 85 — 8y
0
try adding a ) at the end of if part.Position == (-22.467, 7.1, 61.213) xuefei123 214 — 8y
Ad

Answer this question