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

idk how to fix this error attempt to index local 'i' (a number value) how do i fix?

Asked by 5 years ago
local player = game.Players.LocalPlayer 
local mouse = player:GetMouse()
local toggle = false

mouse.KeyDown:connect(function(key)
 if not toggle and key == "r" then



local i =  Instance.new("Part",workspace)
i.Shape = "Ball"
i.Size = Vector3.new(1.05, 1.05, 1.05)
i.Material ="Neon"

i.BrickColor = BrickColor.Black()
for i =0,1,0.01 do 
 wait()
 i.CFrame = i.CFrame:lerp(player.Character.Head.CFrame,i)
end

 end
end)
0
wow thx helleric -3 — 5y
0
You're likely getting a name conflict. Use a different name for "local i" or the "i" in the "for i =0,1,0.01 do" Cousin_Potato 129 — 5y
0
Yeah that's the problem. User#19524 175 — 5y
0
Change connect and KeyDown to UIS and Connect to avoid future problems as well ABK2017 406 — 5y

Answer this question