Error: attempt to multiply a Vector3 with an incompatible value type or nil So I'm trying when you click the part, it should be like 500 studs, then after 5 seconds it should come back, and it's not working, any help?
local allGoldbars = workspace.GoldBars:GetChildren()
for i, v in pairs(allGoldbars) do
local clickDetectorsGoldBars = Instance.new("ClickDetector")
clickDetectorsGoldBars.Parent = v
clickDetectorsGoldBars.MouseClick:Connect(function(player)
print("hi")
local francs = player.leaderstats.Francs
francs.Value = francs.Value + 1
v.CFrame = v.CFrame - Vector3.new(0, 500, 0) * CFrame.Angles(0, math.rad(90), math.rad(180))
wait(5)
v.CFrame = v.CFrame - Vector3.new(0, -500, 0) * CFrame.Angles(0, math.rad(90), math.rad(180))
end)
end

2 comments
Could you post on which line that error is occuring?
v.CFrame = v.CFrame - Vector3.new(0, 500, 0) * CFrame.Angles(0, math.rad(90), math.rad(180))