UserInputService.InputBegan:Connect(function(input, processed)
if input.KeyCode == Enum.KeyCode.B then
BuildingMode = true
--// Calling Module Functions
PlacementHologramModule:HologramPartCreation()
PlacementHologramModule:HologramPositionMovement(Mouse, BuildingMode)
task.spawn(function()
PlacementHologramModule:HologramOrientationMovement(BuildingMode)
end)
UserInputService.InputBegan:Connect(function(input, processed)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
PlacementHologramModule:HologramPartDestroying()
BuildingMode = false
end
end)
end
end)
The BuildingMode function only comes up as false within the Module Script before B is pressed, after that it is always set to true for som reason. If you also see any other optimizations possible in my code, let me know as I am quite new.