im trying to remake a script i made where I could place parts into the map with a tool, for some reason im getting this error on line 35, any help?
--To do, fix this local tool = script.Parent local player = game.Players.LocalPlayer local character = player.Character local handle = tool.Handle local mouse = player:GetMouse() local currentrotation = 0 local currentparttype = 0 local createdholopart = false -- functions local function holo(parttype) if not tool:FindFirstChild("HoloPart") then print("CreateHoloPart") if parttype == 0 then local holopart = tool.Assets.WallPartHologram:Clone() holopart.Name = "HoloPart" holopart.Parent = tool else if parttype == 1 then end end end end local function updholo(mouse) print("Updating") if tool:FindFirstChild("HoloPart") then print("Updated") local mouse = mouse tool.HoloPart.CFrame = CFrame.new(mouse.Hit.p) -- error is here tool.HoloPart.Rotation = Vector3.new(0, currentrotation, 0) end end -- events tool.Equipped:Connect(function() holo(currentparttype) mouse.Idle:Connect(function(mouse) --yeet --local function holo(parttype) -- if parttype == 0 then -- local holopart = tool.Assets.WallPartHologram:Clone() -- holopart.Name = "HoloPart" -- else -- if parttype == 1 then -- -- end -- end -- -- --end -- --local function updholo(mouse) -- if tool:FindFirstChild("HoloPart") then -- print("Updated") -- local mouse = mouse -- tool.HoloPart.CFrame = CFrame.new(mouse.Hit.p) -- tool.HoloPart.Rotation = Vector3.new(0, currentrotation, 0) -- end --end --yeet print("Yo") if tool:FindFirstChild("HoloPart") then print("Sending updator") updholo(mouse) else holo(currentparttype) end end) mouse.Button1Down:Connect(function(mouse) print("Clicked") print(mouse.Hit.p) end) game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessedEvent) if input.KeyCode == Enum.KeyCode.R then currentrotation = currentrotation + 45 else if input.KeyCode == Enum.KeyCode.F then currentparttype = currentparttype + 1 if tool:FindFirstChild("HoloPart") then tool.HoloPart:Destroy() holo(currentparttype) end if currentparttype > 1 then currentparttype = 0 end end end end) end)