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

Vector 3 expected, got Cframe?

Asked by 3 years ago
local clickdetector = script.Parent.ClickDetector
local replicatedstorage = game:GetService("ReplicatedStorage")
local Scare = replicatedstorage.JumpScareFile.MOVINGSCARY
local noise = script.Parent.Parent.Noise

clickdetector.MouseHoverEnter:Connect(function(plr)
    local player = game.Workspace:FindFirstChild(plr.Name)
    script.Parent.Parent:Destroy()
    local copy = Scare:Clone()
    copy.Parent = workspace
    local noisecopy = noise:Clone()
    noisecopy.Parent = player

    for i = 1, 29 do
        wait(0.1)
        copy.Position = CFrame.new(copy.Position + Vector3.new(1, 0, 0)) -- issue

        if i == 1 then
            noisecopy:Play()
        elseif i == 28 then
            noisecopy:Destroy()
        end
    end

    copy:Destroy()
    script.Parent.Parent:Destroy()
end)

Im not too sure how to change position so I looked up how to and the code I have is what it said. If anyone could help that would be appreciated.

1
put .Position at the end of the last parenthesis on line 16 greatneil80 2647 — 3y
0
thanks tightanfall 110 — 3y

1 answer

Log in to vote
0
Answered by
EmK530 143
3 years ago

Try changing the beginning of the line from copy.Position to copy.CFrame and see if it works.

Ad

Answer this question