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

Vector 3 expected, got Cframe?

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.

2 comments

1

put .Position at the end of the last parenthesis on line 16

0

thanks

1 answer

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

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