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.
Try changing the beginning of the line from copy.Position
to copy.CFrame
and see if it works.